DOS and the Attrib Command
Friday, January 20, 2012 at 12:39PM Today I was working on a problem that seemed to have no easy answer other than using a VB script of a batch file. Yet I found one in lowly DOS commands.
The issue that I was having we as that I had a large number of directories that I need to change that attibutes on. The folders all had the hidden and system attribute and I wanted to change it so that they could be seen.
I started working on a batch file to run the attrib -s -h on each folder but was having a probelm that, even though it seemed to process the command correctly, it failed to actually change the attibute.
Then as I was looking at the switches for the attrib command I found the /S /D switches that I never knew about.
So my long batch file that I was creating and testing for 90 minutes was simply replaced by this:
attrib -r -s /S /D
Voila! Done.
...Just in time to go home for lunch!
DOS,
batch file 





Reader Comments