MSDOS Help

Ripley

Registered User.
Local time
Today, 22:52
Joined
Aug 4, 2006
Messages
148
Hi.

I do not realy program in ms dos, but I need to take away the read only attribues for some files in a given directory, as currently only administrators on my network can access them. The read only attributes can only be removed in DOS with the command:

Code:
attrib <directory>\<filename>

I want to create an itteration statement to loop through all files and folders within a given directory and change the attrbutes accordingly.

Any help appriciated. Thanks.
 
Do you have to do this in DOS.

Why not simple change the Read Only in the Folder Properties. I believe this will change the Properties of all the Files within the Folder.
 
If this is something that must be done on a regular basis, you could just do attrib on *.* (inside or outside a batch file). You can also do a for loop in a DOS batch file and run the command there (if there are other actions you need to perform).
 
Are you doing this for all of the files in a particular directory?
Code:
attrib <directory>\*.* -r

or

If there is something common about all of the file names that you want to change
Code:
attrib <directory>\*this*.* -r
This will change any file with the word this contained in the file name or if an extention name such as a text file
Code:
attrib <directory>\*.txt -r
 
Hi

Following on from the previous post, you can remove the attribute from all files in the directory and all sub-directories by using:

Code:
attrib -r *.* /s

This can be used inside a batch file or at the command prompt.
 
attrib <directory>\*this*.* -r
Please note, when dealing with filenames, any string with an asterisk on both sides of it, does not work properly in any version of MS-DOS. In fact, this syntax does not work on any version of DOS or unix I have ever used.

In theory it is possible, in practice it is not.
 

Users who are viewing this thread

Back
Top Bottom