March 26, 200818 yr I have several machines that have had people playing around with the ATTRIBcommand. Now, I have some files that are no longer hidden like they shouldbe. I have a batch file that seems like it should work but in fact does not.Any guidance would be great! Below is an example. I just want to searchrecursively through the current folder and its child directories and run acommand if the file is found....FOR /F %%I IN ("DESKTOP.INI") DO IF EXIST %%~nI ATTRIB +S +H DESKTOP.INI /SRunning that command outputs an error:%%I was unexpected at this time.
March 26, 200818 yr If you want to process all DESKTOP.INI files in the current tree all you need to run is the attrib command from the desired folder.ATTRIB +s +H DESKTOP.INI /SThe /S does the recursive searching for you. If you want to check the current folder before you run it use:If EXIST DESKTOP.INI ATTRIB +S +H DESKTOP.INI /S
March 26, 200818 yr Author If you want to process all DESKTOP.INI files in the current tree all you need to run is the attrib command from the desired folder.ATTRIB +s +H DESKTOP.INI /SThe /S does the recursive searching for you. If you want to check the current folder before you run it use:If EXIST DESKTOP.INI ATTRIB +S +H DESKTOP.INI /SOk, I'll try that...
Create an account or sign in to comment