Yzöwl Posted July 28, 2006 Posted July 28, 2006 @ mazinJust an addition or change to your information:if you useDEL/F/A/S/Qyou will not need to useATTRIBbecause the /A switch used blindly will take care of all attributes!
mazin Posted July 28, 2006 Posted July 28, 2006 @ mazinJust an addition or change to your information:if you useDEL/F/A/S/Qyou will not need to useATTRIBbecause the /A switch used blindly will take care of all attributes!Actually, I used attrib -r -a -s -h with /S to remove attributes from files in the main directory and subdirectories.attrib -r -a -s -h /S /D "%TEMP%"I added /D to remove attributes from subdirectories, as well. This will make it be easy for rd /S /Q "%TEMP%\" to delete all subdirectories without leaving some ones behind.It could be good if /A (your idea) is functioning the same with directories. I mean something like this: rd /A /S /Q "%TEMP%\"If it could be, then three lines of code can be shrinked to one. My TEMP is now clean; so I can't test it, however.Thanks for the tip anyway.
Yzöwl Posted July 29, 2006 Posted July 29, 2006 (edited) This batch file code will remove all files and directories which are not in use from the users temp files location.FOR /F "DELIMS=" %%? IN ('DIR/B/AD %TEMP%\*') DO RD/S/Q "%%~f?"DEL/F/A/Q %TEMP%\*.*Like I said, system files and directories, hidden files and directories and read only files and directories are taken into account.<Edit>Oh and BTWrd /S /Q "%TEMP%\"will not preserve the Temp directory, it will remove it too.</Edit> Edited July 29, 2006 by Yzöwl
Andromeda43 Posted July 29, 2006 Posted July 29, 2006 So much work for such a small return! All you need to get a thorough HD cleanup on every boot is my XPCleanup.bat program.It uses the Deltree.exe program found on any windows 98, 98/SE or ME computer.It's also on My WebpageEvery temp folder or cache folder on the HD is emptied in just a few seconds.The batch file or a shortcut to it can be placed in the Startup folder for free maid service every time you boot up your PC. A clean PC is a Happy PC. Then run "Disk Cleanup" and "Defrag" once a week for a really Happy PC. Since its a simple DOS batch file, lines can be added or removed to suit your personal needs and desires.Both the batch file and Deltree.exe are contained in my "Care Package" found on my Download Site, Here.I've even included an Install program for it.In the Care Package, read the Instruction file before running any of the programs.Happy Computing!Andromeda43
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now