Emnico in Swindon and its partners
in the UK and Europe provide:

» IT Support Services and Products
» Bespoke Software Development


Contact our Swindon office on:
+44 (0)1793 614 700
to discuss your IT needs.


CLOSE IT
Emnico Logo
Your Virtual Technology Team
Delivering Peak Performance
Category: Type: Order:
Search For:  
Home > Library > Disk Cleanup

Disk Cleanup

Files will be removed from various temporary directories, including Internet Explorer's temporary internet files.
Added 338 days ago by Emnico
Download
Review
Back
578Views
This script has been successfully tested by Emnico and is verified to be working.

Source code

regPath1 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders\StateFlags2345"
regPath2 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Compress old files\StateFlags2345"
regPath3 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Content Indexer Cleaner\StateFlags2345"
regPath4 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files\StateFlags2345"
regPath5 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files\StateFlags2345"
regPath6 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files\StateFlags2345"
regPath7 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Microsoft_Event_Reporting_2.0_Temp_Files\StateFlags2345"
regPath8 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Office Setup Files\StateFlags2345"
regPath9 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Files\StateFlags2345"
regPath10 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files\StateFlags2345"
regPath11 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files\StateFlags2345"
regPath12 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin\StateFlags2345"
regPath13 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Remote Desktop Cache Files\StateFlags2345"
regPath14 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files\StateFlags2345"
regPath15 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files\StateFlags2345"
regPath16 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Offline Files\StateFlags2345"
regPath17 = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\WebClient and WebPublisher Cache\StateFlags2345"

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.RegWrite regPath1, 0, "REG_DWORD"
objShell.RegWrite regPath2, 0, "REG_DWORD"
objShell.RegWrite regPath3, 0, "REG_DWORD"
objShell.RegWrite regPath4, 0, "REG_DWORD"
objShell.RegWrite regPath5, 2, "REG_DWORD"
objShell.RegWrite regPath6, 0, "REG_DWORD"
objShell.RegWrite regPath7, 0, "REG_DWORD"
objShell.RegWrite regPath8, 0, "REG_DWORD"
objShell.RegWrite regPath9, 0, "REG_DWORD"
objShell.RegWrite regPath10, 0, "REG_DWORD"
objShell.RegWrite regPath11, 0, "REG_DWORD"
objShell.RegWrite regPath12, 0, "REG_DWORD"
objShell.RegWrite regPath13, 0, "REG_DWORD"
objShell.RegWrite regPath14, 0, "REG_DWORD"
objShell.RegWrite regPath15, 0, "REG_DWORD"
objShell.RegWrite regPath16, 0, "REG_DWORD"
objShell.RegWrite regPath17, 0, "REG_DWORD"

objShell.Run "cleanmgr /sagerun:2345"


| Privacy policy | Environmental policy | Site map |