Strict Standards: Non-static method AL_HELPER::SetupPaths() should not be called statically in /home/software/public_html/windowsxp/init.php on line 15
A better disk cleanup

Still have a problem? Ask for help at our discussion forum.

Advanced Search
Article Options
Popular Articles
  1. Handwrite for MSN Messenger
  2. Win2000 Logon Screen
  3. The difference between 64 and 32 bit processors
  4. Windows XP FAQ T
  5. Windows XP FAQ P
No popular articles found.

 »  Home  »  Usability Page 2  »  A better disk cleanup
A better disk cleanup
By  Super Admin  | Published  02/23/2005 | Usability Page 2 | Rating:
A better disk cleanup

This tip assumes you have Windows XP installed in c:\windows.

Step 1.
Create a new text file and place the following contents inside:

c:\windows\system32\cleanmgr.exe /dc /sageset: 1
cd \
cd c:\windows\prefetch
del *.* /q

Step 2.
Save the file, changing the extension from .txt to .bat
For this tip's purpose, we will call it clean.bat

Step 3.
Execute the file.  This will run the Disk Cleanup program in a special mode which asks what items you will want cleaned when Disk Cleanup performs an unattended cleanup.  Check the items you wish to have cleaned up, then click OK.

Step 4.
Right-click on the clean.bat file and click edit.  Change the first line to read:

c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Step 5.
Save the file.  You can execute this file in place of running Disk Cleanup, or, to have this program run unattended, run the Add Scheduled Task Wizard in the Control Panel and create a scheduled task using the clean.bat file you just created.

Note:  This cleanup script will also clear windows prefetch directory.  Often this directory can become cluttered with old appication and a cleaning would free up disk space but it will result in a one time performance decrease and windows has to rebuild the cache with active software afterwards.

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Send to Author Post on Site

  • Comment #1 (Posted by an unknown user)
  • Comment #2 (Posted by an unknown user)
    Also still prompting when using stagerun option, totally ridiculous. What's the point of such a job if I cannot run it unattended?
  • Comment #3 (Posted by an unknown user)
    This is too complicated for someone who does not know how to empty a recycle bin. Useless to me.
  • Comment #4 (Posted by an unknown user)
    This would be great if it would stop prompting to select what to clean. Going from sageset: 1 to sagerun: 1 should take care of this process but it is not working for me.
Submit Comment