Scripting Question

disk clean up

12/27/2012 2796 views

disk clean up

0 Comments   [ + ] Show comments


Community Chosen Answer



Answered 12/27/2012 by: dugullett
Red Belt

  • Remember to form your answer in the form of a question.
    • Nuke it from orbit, it's the only way to be sure.

All Answers


Microsoft offers a crowd-sourced repository for scripts. If you're looking for "clean up" scripts, you can check here:



Answered 12/27/2012 by: tshupp
2nd Degree Black Belt


Was someone just looking for the points when posting a questions???? Come on...admit it =)

Answered 12/27/2012 by: nshah
Red Belt

  • hey you just got points for answering

I would run sageset:1 on a test box built for this purpose, then export the registry key for sageset [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches] to a network drive accessable to the target machine.

create a "verify" batch file in kbox scripting that will import that sageset registry key.  for example mine looks like this "regedit /s \\roadster\IT-Systems\xpscripts_donotdelete\sageset.reg"  Replace \\roadster\it-systems... with the path to your sageset registry key

then create an "on success" script that will run disc cleanup with the parameters you selected on your test box.  I chose "on sucess, run a batch file" and typed in "c:\windows\system32\cleanmgr.exe /sagerun:1"  that referenced the settings that were imported by the first step above.

I'm assuming you're using the KBOX 1000 scripting for this, otherwise the commands are a bit more convoluted but doable.  Hope this helps

Answered 12/27/2012 by: Strangeronfire
Senior Yellow Belt


DBan it! 



Answered 12/28/2012 by: OSILayer3
White Belt

  • hahahaha. I'm sure he isn't trying to nuke the contents. I'm assuming he is just wanting a disc cleanup script that can be pushed out to multiple computers.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ