![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Change File Attributes I have a set of files in a folder and want to modify their properties. In one folder I have a set of .asx files that I would like to un-block en-mass. In another folder I have a set of .url files that I would like to protect en-mass. Win-XP SP3 -- Gary''s Student - gsnu2007xx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Change File Attributes Quote: > I have a set of files in a folder and want to modify their properties. In > one folder I have a set of .asx files that I would like to un-block Quote: > In another folder I have a set of .url files that I would like to protect > en-mass. > to just write the whole script for you? If not then you need to be more specific about which part has you stumped. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Change File Attributes "Gary''s Student" <GarysStudent@xxxxxx> wrote in message news:9EE80484-0F1B-40D0-9B46-672E8937EE52@xxxxxx Quote: >I have a set of files in a folder and want to modify their properties. In > one folder I have a set of .asx files that I would like to un-block > en-mass. > In another folder I have a set of .url files that I would like to protect > en-mass. > > Win-XP SP3 > -- > Gary''s Student - gsnu2007xx |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Change File Attributes Quote: > attrib.exe is the usual command for such tasks. > which provides access to folders as objects via GetFolder... Each folder object has a Files collection object... each of which has an Attributes property. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Change File Attributes "mayayana" <mayaXXyana@xxxxxx> wrote in message news:ekYb1dj%23IHA.2352@xxxxxx Quote: > Quote: >> attrib.exe is the usual command for such tasks. >> > which provides access to folders as objects via GetFolder... > Each folder object has a Files collection object... each of > which has an Attributes property. re-invent the wheel. If I can do a job with a single-line command then I won't write a ten-line VB Script file to do the same thing. By the way, DOS? I thought DOS was a legacy operating system introduced some 30 years ago and only rarely used these days? |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Change File Attributes "mayayana" <mayaXXyana@xxxxxx> wrote in message news:%234h22%23h%23IHA.872@xxxxxx Quote: > Quote: >> I have a set of files in a folder and want to modify their properties. >> In >> one folder I have a set of .asx files that I would like to un-block Quote: >> In another folder I have a set of .url files that I would like to protect >> en-mass. >> > So what's the question? Do you expect someone > to just write the whole script for you? If not then > you need to be more specific about which part has > you stumped. could be anything from simple changes to the "R" attribute to something more detailed using NTFS permissions. Of course if you are "protecting" a file with NTFS permissions, what are you protecting it from, modification? deletion? being seen at all? What doesn't have me stumped is the reason behind the question posed by someone signing himself as "Gary's Student" - could this possibly be a homework question? /Al |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Change File Attributes Quote: Quote: Quote: > >> attrib.exe is the usual command for such tasks. > >> > > which provides access to folders as objects via GetFolder... > > Each folder object has a Files collection object... each of > > which has an Attributes property. > I'm quite aware of that but since I'm lazy I prefer not to > re-invent the wheel. If I can do a job with a single-line command > then I won't write a ten-line VB Script file to do the same thing. > It might be a bit confusing to newcomers who expect to get WSH script advice to be given a console-level DOS method. They won't find ATTRIB in their WSH CHM file. If you insist on posting DOS methods in a VBS group then wouldn't it make sense to at least explain the VBS method, detail the DOS method, and point out why you think the DOS method is better? Quote: > By the way, DOS? I thought DOS was a legacy operating system > introduced some 30 years ago and only rarely used these days? > http://en.wikipedia.org/wiki/List_of_DOS_commands I gather that MS has somehow polished up the DOS EXEs and re-released them as 32-bit, but I don't see how that makes a difference. You're talking about command line or console operation using a DOS command. |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Change File Attributes "mayayana" <mayaXXyana@xxxxxx> wrote in message news:ehDX9Ul%23IHA.3344@xxxxxx Quote: > Quote: Quote: >> >> attrib.exe is the usual command for such tasks. >> >> >> > In DOS, yes. In VBScript there's the FileSystemObject... >> > which provides access to folders as objects via GetFolder... >> > Each folder object has a Files collection object... each of >> > which has an Attributes property. >> I'm quite aware of that but since I'm lazy I prefer not to >> re-invent the wheel. If I can do a job with a single-line command >> then I won't write a ten-line VB Script file to do the same thing. >> > That's fine. It's just that this is a VBS group. > It might be a bit confusing to newcomers who > expect to get WSH script advice to be given > a console-level DOS method. They won't find > ATTRIB in their WSH CHM file. If you insist on > posting DOS methods in a VBS group then wouldn't > it make sense to at least explain the VBS method, > detail the DOS method, and point out why you think > the DOS method is better? I merely said it was an easier solution to apply. I am quite aware that this is a vbscript group but I notice that some posters are blissfully unaware that some standard admin tasks have a console command tailored for just this purpose. A little while ago someone posted a question here about a recursive copy task with some date restrictions. He ran into a brick wall with his 60-odd line script. He was flabbergasted to read that robocopy.exe could do it in a single line of code. This is why I sometimes point out a console command alternative. Quote: Quote: >> By the way, DOS? I thought DOS was a legacy operating system >> introduced some 30 years ago and only rarely used these days? >> > DOS. Yes. > http://en.wikipedia.org/wiki/List_of_DOS_commands > I gather that MS has somehow polished up the > DOS EXEs and re-released them as 32-bit, but > I don't see how that makes a difference. You're > talking about command line or console operation > using a DOS command. or Linux. DOS is characterised by being a 16-bit OS, by its boot files io.sys, msdos.sys, config.sys and autoexec.bat, all of which have no place in the WinNT engine. DOS also has some fundamental commands such as sys.com and fdisk.exe, neither of which have a place in the WinNT family of OSs. The Windows command console shares the black screen with DOS and quite a few commands but the majority of its .exe files will not run on a DOS machine. Calling the Command Console "DOS" is frequently causing confusion, with some posters talking about fdisk or config.sys when dealing with boot issues. Using the proper term "Command Console" would avoid this confusion. I admit, however, that even Microsoft engineers use the term DOS at times when speaking about the command console. Old habits die hard . . . |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Change File Attributes Hi Al: Thank you for responding. If you right-click a file and select Properties, at the bottom of the General tab is an area for Attributes. You can select either Read-only or Hidden or both. I would like to programmatically select Read-only for all the files in a folder. If the file has ben blocked, the General tab has an unblock button that I would like to access programmatically. As you have correctly guessed, I am a Student; but this is nto a homework assignment. -- Gary''s Student - gsnu200799 "Al Dunbar" wrote: Quote: > > "mayayana" <mayaXXyana@xxxxxx> wrote in message > news:%234h22%23h%23IHA.872@xxxxxx Quote: > > Quote: > >> I have a set of files in a folder and want to modify their properties. > >> In > >> one folder I have a set of .asx files that I would like to un-block Quote: > >> In another folder I have a set of .url files that I would like to protect > >> en-mass. > >> > > So what's the question? Do you expect someone > > to just write the whole script for you? If not then > > you need to be more specific about which part has > > you stumped. > What has me stumped is what he means my "un-blocking" and "protecting". This > could be anything from simple changes to the "R" attribute to something more > detailed using NTFS permissions. Of course if you are "protecting" a file > with NTFS permissions, what are you protecting it from, modification? > deletion? being seen at all? > > What doesn't have me stumped is the reason behind the question posed by > someone signing himself as "Gary's Student" - could this possibly be a > homework question? > > /Al > > > |
My System Specs![]() |
| | #10 (permalink) |
| | Re: Change File Attributes > DOS .... have no Quote: > place in the WinNT engine. > Quote: > Calling the Command Console "DOS" is frequently causing confusion, > with some posters talking about fdisk or config.sys when dealing with > boot issues. Using the proper term "Command Console" would avoid this > confusion. > > I admit, however, that even Microsoft engineers use the term DOS > at times when speaking about the command console. Old habits die hard . . Quote: > an MS-DOS window. I can also boot to DOS, where I can run an ATTRIB command. (And if I happen to be dual-booting with XP on a FAT32 partition I can also use that DOS ATTRIB command on my XP files.) If I open a "console" window in XP I can also run an ATTRIB command. The command is the same. The method and window are basically the same. It seems to me that what you like to call "command console" is, in this case, basically 32-bit DOS emulation. I call it DOS because you're using DOS commands and you're using them in DOS fashion: in a text-only interface. So if it looks like DOS, acts like DOS and is used like DOS then I call it DOS, just as I would call Power Shell "Power Shell", or call VBS "VBScript" and not "GUI Control Tool". Though I might sometimes refer to VBScript as "the scripting tool created to replace the outdated, text-only DOS tools when PCs began to have modern amenities like mice and a graphical interface" ![]() |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| File attributes | .NET General | |||
| change attributes in Vista? | Vista installation & setup | |||
| File Attributes | Vista General | |||
| file attributes | PowerShell | |||
| Folder Attributes - Unable to change | Vista General | |||