Need a script to traverse the subdirectories under the current root directory, without going into deeper directories, and use attrib -h to remove the hidden attribute.
Mainly because USB flash drive viruses always set the subdirectories under the root of the USB drive as hidden, so I need a script like this to quickly reset them.
-----------------------
Damn, I didn't look carefully at the dir parameters, so I couldn't get any result all along. This line works now,
Mm, thanks to HAT for the reminder. It should work now. It's been so long, I hardly know how to use for anymore, hehe
[ Last edited by dato on 2008-8-24 at 12:18 PM ]
Mainly because USB flash drive viruses always set the subdirectories under the root of the USB drive as hidden, so I need a script like this to quickly reset them.
-----------------------
Damn, I didn't look carefully at the dir parameters, so I couldn't get any result all along. This line works now,
for /f %%a in ('dir /b/adh') do attrib -h -s -r "%%a"
pauseMm, thanks to HAT for the reminder. It should work now. It's been so long, I hardly know how to use for anymore, hehe
for /f "delims=" %%a in ('dir /b/adh 2^>nul') do @attrib -h -s -r "%%a"
pause[ Last edited by dato on 2008-8-24 at 12:18 PM ]

