So something I normally do is delete leftover files from uninstalled programs in ProgramData and AppData folders. However, I always have to unhide all folders, change the attributes on those folders to keep them unhidden, then hide all hidden files again. I tried to make a batch file to do this, and tested it on my computer. I thought it had worked, yet when I tried to run it on another computer, it didn't work correctly, even though I had added wildcard characters. Here are the contents of the batch file. Please let me know what, if anything, needs to be fixed: ATTRIB -H "C:\Users\%username%\AppData\*" /S /D ATTRIB -H "C:\ProgramData\*" /S /D pause Thanks
Tried it. Most files say "Access Denied" even though I run it as an administrator. However, ProgramData seems to be unhidden, but AppData doesn't seem to run at all.
Appdata is a system folder. You have to use the system attribute at same time as the hidden attribute because a system file or folder is extra hidden. A system file or system folder cannot be unhidden without -s. This will work Code: ATTRIB -H -S "C:\Users\%username%\AppData\*" /S /D ATTRIB -H -S "C:\ProgramData\*" /S /D and with the read only flag. Code: ATTRIB -H -S -R "C:\Users\%username%\AppData\*" /S /D ATTRIB -H -S -R "C:\ProgramData\*" /S /D
Ok here's another shot, it should work independent of the windows installation drive. Add -s switch after attrib command to reveal system files too. Code: %homedrive% ATTRIB -H -R "%homepath%\AppData\*" /S /D ATTRIB -H -R "%allusersprofile%\*" /S /D