Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate Diskcleanup 1

Status
Not open for further replies.

silver2kgt

Technical User
Nov 18, 2003
19
0
0
US
I am trying to figure out how I can setup Disk Cleanup in XP Pro to run once a month on my company's desktops. I have the task scheduler part down. I found a Microsoft article that allows you to setup diskcleanup to run with custom settings (what items to delete), but it doesn't say where in the registry the updates are made when you run cleanmgr.exe /sageset:n (where n is any number from 0 - 65536) and then make the modifications. This supposedly makes an entry into the registry so that you can refer to it later with cleanmgr.exe /sagerun:n. If I knew the location in the registry I could export the reg key and import it to all of our PC's and all of this would work great (we have 200+ PC's here and I don't really want to go to each PC to set this up.) Can anyone help on this or done this before and know where in the registry these keys are located? Thanks in advance.
 
Set up the disk cleanup tool with sageset exactly as you want.

Then use regedit to export this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
Then use notepad to create a sageset.reg file"

REGEDIT4

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\]

(now the contents of your exported key)

In the logon script push the instruction:

regedit /s sagest.reg

Please test this first, as it is easy to screw up things.
But it should work without issue if the sagest.reg is done with care.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top