Automating Disk Cleanup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I support a distributed network of all Windows XP workstations, on an Active Directory network. I'd like to create an automated job that periodically runs Disk Cleanup against the workstations to cleanup things like temp files and temp internet files. I don't want to run all of the full disk cleanup options such as compressing old files.

I found KB article 315246 that talks about how to run it from a command line, but it references that the \sageset parameter creates a registry key to store the settings unfortunately it doesn't specify the key that gets created

I want to be able to run this against about a 1000 workstations. If there a Group Policy template or a reference to where the settings are stored in the registry
 
Each item in the cleaner is a seperate com program. The list of cleaners is stored here
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches

StateFlags<n> where n is the sageset number

Make your own cleaners.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\CustomDeleter]
@="{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}"
"FileList"="*.fred"
"Folder"=hex(2):63,00,3a,00,5c,00,64,00,65,00,73,00,6b,00,74,00,6f,00,70,00,00,\
00
"Flags"=dword:00000000
"LastAccess"=dword:00000002
"StateFlags"=dword:00000001
"Display"="Custom"
"Description"="Clears a custom folder"

To make multiple cleaners just change the last key name (CustomDeleter)

Seperate multiple filetypes like so (pipe)
*.fred|*.horse

Seperate multiple directories the same way.
c:\desktop|C:\games

Use this syntax for directories
?:\recycled

Which will do all drives or the specified drive (depending on how cleanup is being used)

Last Access can be set to 0 for instant deleting.
 
Back
Top