|
Answer» Hello Everyone!
I am trying to automate the disk CLEANUP process. I am wanting to use it under scheduled tasks. The idea is to be able to RUN a ".bat" file that will automatically add the entry to run disk cleanup. The only issue i am having is getting disk clean up to run unattended. It is important to have it run unattended because i work at a school and the student cannot be prompted for it. Can anyone please assist me?
Operating system being used: XP Pro SP3First:
Run cleanmgr /sageset=nn either from the run box or the cmd prompt where nn is any arbitrary number.
When the Disk Cleanup Settings window appears, check off the boxes you want disk cleanup to clean. Click OK to save settings.
Second:
To run unattended, run cleanmgr /sagerun=nn where nn is the same arbitrary number you used for sageset. Cleanmgr can be run from a batch file, windows script, the windows run box or the NT cmd prompt.
Disk cleanup run this way will clean all the disks on your system using the same settings. I'll leave it to your imagination to have different settings for each disk.
Good luck. I do appreciate your answer, but that is were the issue is. I really need to not have to check anything. It needs to be completely automated. Any other ideas? I probably should have been more clear. You need run sageset only once. Sagerun will CONTINUE to use the sageset settings until they are changed in which case it will use the new settings.
Note: the settings are stored in the registry, so they persist across system boots.
Perhaps this article will clear things up.
Thank you for your post. I understand the sageset and sagerun options. Do you know if there are registry entries for each checked item?
If there is i could probably export those keys, then export the sageset number. Then in my .bat file just add the entries to the new computer and then add the sageset number registry key. Then the last part of the .bat could be sagerun?
Does this make sense? Do you know if these keys exist? I will RESEARCH today for any.
Thank you for the assistance!
HoFLThe cleanmgr settings can be found in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches registry key and subkeys.
Backup the registry before you start. Messing with the registry can turn your PC into a brick!
Good luck. I know it can
I will post my results. Thanks again for the help!
|