Sign in to follow this  
Followers 0
Zinthose

Automate Disk Cleanup [CleanMgr.exe]

14 posts in this topic

#1 ·  Posted (edited)

Using the information provided by Microsoft at http://support.microsoft.com/kb/315246 I created a small script that automates the Disk Cleanup utility.

The script also create a logfile at "C:\SetupLogs\DiskClean.log" and also creates the necessary registry entries to automate the following tasks:

  • Active Setup Temp Folders = Enabled
  • Compress old files = Enabled
  • Content Indexer Cleaner = Enabled
  • Downloaded Program Files = Disabled
  • Internet Cache Files = Enabled
  • Memory Dump Files = Enabled
  • Old ChkDsk Files = Enabled
  • Recycle Bin = Disabled
  • Remote Desktop Cache Files = Enabled
  • Setup Log Files = Enabled
  • Temporary Files = Enabled
  • WebClient and WebPublisher Cache = Enabled

Here is a sample from the log file:

CODE
2008-08-22 16:20:57 : ********* Start Disk Cleanup *********

2008-08-22 16:20:57 : Adding Registry entries to automate CleanMgr.exe

2008-08-22 16:20:57 : Free Drive Space on Drive C: = 4758.97265625 MB

2008-08-22 16:20:57 : Free Drive Space on Drive D: = 637.1142578125 MB

2008-08-22 16:20:57 : Free Drive Space on Drive E: = 13449.3828125 MB

2008-08-22 16:20:57 : Executing Disk Cleanup Utility

2008-08-22 16:20:57 : Disk Cleanup Utility PID=2624

2008-08-22 16:20:57 : Status: Target type:

2008-08-22 16:20:57 : Status: exefile

2008-08-22 16:20:58 : Status: Disk Cleanup is calculating how much space you will be able to free on (C:). This may take a few minutes to complete.

2008-08-22 16:20:58 : Status: Calculating...

2008-08-22 16:20:58 : Status: Compress old files

2008-08-22 16:21:05 : Status: Downloaded Program Files

2008-08-22 16:21:05 : Status: Recycle Bin

2008-08-22 16:21:05 : Status: Temporary files

2008-08-22 16:21:05 : Status: The Disk Cleanup utility is cleaning up unnecessary files on your machine.

2008-08-22 16:21:05 : Status: Cleaning up drive (C:).

2008-08-22 16:21:05 : Status: Downloaded Program Files

2008-08-22 16:21:06 : Status: Temporary Internet Files

2008-08-22 16:21:07 : Status: Disk Cleanup is calculating how much space you will be able to free on (C:). This may take a few minutes to complete.

2008-08-22 16:21:07 : Status: Calculating...

2008-08-22 16:21:07 : Status: WebClient/Publisher Temporary Files

2008-08-22 16:21:07 : Status: Target type:

2008-08-22 16:21:07 : Status: exefile

2008-08-22 16:21:07 : Status: Disk Cleanup is calculating how much space you will be able to free on Application (D:). This may take a few minutes to complete.

2008-08-22 16:21:07 : Status: Calculating...

2008-08-22 16:21:07 : Status: Compress old files

2008-08-22 16:21:08 : Status: Catalog files for the Content Indexer

2008-08-22 16:21:08 : Status: The Disk Cleanup utility is cleaning up unnecessary files on your machine.

2008-08-22 16:21:08 : Status: WebClient/Publisher Temporary Files

2008-08-22 16:21:08 : Status: Disk Cleanup is calculating how much space you will be able to free on Application (D:). This may take a few minutes to complete.

2008-08-22 16:21:08 : Status: Disk Cleanup is calculating how much space you will be able to free on User (E:). This may take a few minutes to complete.

2008-08-22 16:21:08 : Status: Compress old files

2008-08-22 16:21:09 : Status: ??A?

2008-08-22 16:21:09 : Status: Target type:

2008-08-22 16:21:09 : Status: exefile

2008-08-22 16:21:09 : Disk Cleanup Utility operation completed

2008-08-22 16:21:10 : Free Drive Space on Drive C: = 4758.921875 MB

2008-08-22 16:21:10 : Free Drive Space on Drive D: = 637.1142578125 MB

2008-08-22 16:21:10 : Free Drive Space on Drive E: = 13449.3828125 MB

2008-08-22 16:21:10 : Operation Completed RC=512

2008-08-22 16:21:10 : ********* End Disk Cleanup *********

********************************************************************************

Here is the code itself:

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=ClnMgr.ico
#AutoIt3Wrapper_outfile=..\DiskCleanup.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=Automated and Silent execution of the Windows Disk Cleanup utility.
#AutoIt3Wrapper_Res_Fileversion=1.0.0.14
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Res_Field=.Active Setup Temp Folders|Enabled
#AutoIt3Wrapper_Res_Field=.Compress old files|Enabled
#AutoIt3Wrapper_Res_Field=.Content Indexer Cleaner|Enabled
#AutoIt3Wrapper_Res_Field=.Downloaded Program Files|Disabled
#AutoIt3Wrapper_Res_Field=.Internet Cache Files|Enabled
#AutoIt3Wrapper_Res_Field=.Memory Dump Files|Enabled
#AutoIt3Wrapper_Res_Field=.Old ChkDsk Files|Enabled
#AutoIt3Wrapper_Res_Field=.Recycle Bin|Disabled
#AutoIt3Wrapper_Res_Field=.Remote Desktop Cache Files|Enabled
#AutoIt3Wrapper_Res_Field=.Setup Log Files|Enabled
#AutoIt3Wrapper_Res_Field=.Temporary Files|Enabled
#AutoIt3Wrapper_Res_Field=.WebClient and WebPublisher Cache|Enabled
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Include <File.au3>
#include <String.au3>
#Include <Misc.au3>
_Singleton("Global\CleanDisk", 2)


;## CleanMgr

Dim Const $RegPath    = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\"
Dim Const $StateFlag    = "StateFlags0064"
Dim Const $REGDWORD  = "REG_DWORD"

Dim Const $Process    = "CleanMgr.exe"
Dim Const $RunCmd      = $Process & " /sagerun:65"
Dim Const $WindTitle    = "Disk Cleanup"
Dim Const $LogPath    = "C:\SetupLogs\DiskClean.log"

Dim Const $Enabled    = 2
Dim Const $Disabled  = 0

Global $Status[3]

_FileWriteLog($LogPath, " ********* Start Disk Cleanup *********")

If ProcessExists($Process) Then
    _FileWriteLog($LogPath, "Utility is allready running.")
    _FileWriteLog($LogPath, "Operation Interupted RC=514")
    _FileWriteLog($LogPath, " ********* End HRA-O Disk Cleanup *********" & @CRLF & _StringRepeat("*", 80))
    Exit 514
EndIf

_FileWriteLog($LogPath, "Adding Registry entries to automate CleanMgr.exe")

AddHandler_FireFox();   <== Add FireFox Support

RegWrite($RegPath & "Active Setup Temp Folders"         , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Compress old files"                , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Content Indexer Cleaner"           , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Downloaded Program Files"          , $StateFlag, $REGDWORD, $Disabled)
RegWrite($RegPath & "Internet Cache Files"              , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Memory Dump Files"                 , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Old ChkDsk Files"                  , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Recycle Bin"                       , $StateFlag, $REGDWORD, $Disabled)
RegWrite($RegPath & "Remote Desktop Cache Files"        , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Setup Log Files"                   , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "Temporary Files"                   , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "WebClient and WebPublisher Cache"  , $StateFlag, $REGDWORD, $Enabled)
RegWrite($RegPath & "FireFox Cache"                     , $StateFlag, $REGDWORD, $Enabled)

Dim $Drives = DriveGetDrive("FIXED")

For $i = 1 to $Drives[0]
    _FileWriteLog($LogPath, "Free Drive Space on Drive " & StringUpper($Drives[$i]) & " = " & DriveSpaceFree( $Drives[$i] & "\" ) & " MB")
Next

_FileWriteLog($LogPath, "Executing Disk Cleanup Utility")

Local $PID = Run($RunCmd, "", @SW_HIDE)
ProcessSetPriority($Process, 1)

_FileWriteLog($LogPath, "Disk Cleanup Utility PID=" & $PID)

AdlibEnable("_WindowSearch", 10)
    While ProcessExists($Process)
        Sleep(1000)
    WEnd
AdlibDisable()

_FileWriteLog($LogPath, "Disk Cleanup Utility operation completed")

For $i = 1 to $Drives[0]
    _FileWriteLog($LogPath, "Free Drive Space on Drive " & StringUpper($Drives[$i]) & " = " & DriveSpaceFree( $Drives[$i] & "\" ) & " MB")
Next

_FileWriteLog($LogPath, "Operation Completed RC=512" )
_FileWriteLog($LogPath, " ********* End Disk Cleanup *********" & @CRLF & _StringRepeat("*", 80))
Exit 512

Func _WindowSearch()
    Local $TempText = WinGetText($WindTitle)
    If WinExists($WindTitle) Then
        Local $Data
       
        If Bitand(WinGetState($WindTitle), 2) Then
            WinSetState($WindTitle, "", @SW_HIDE)
        EndIf
       
        $Data = ControlGetText($WindTitle, "", "[CLASSNN:Static2]")
        If $Data <> "" Then
            If $Data <> $Status[0] Then
                $Status[0] = $Data
                _FileWriteLog($LogPath, "Status: " & $Data)
            EndIf
        EndIf
       
        $Data = ControlGetText($WindTitle, "", "[CLASSNN:Static3]")
        If $Data <> "" Then
            If $Data <> $Status[1] Then
                $Status[1] = $Data
                _FileWriteLog($LogPath, "Status: " & @TAB & $Data)
            EndIf
        EndIf
       
        $Data = ControlGetText($WindTitle, "", "[CLASSNN:Static4]")
        If $Data <> "" Then
            If $Data <> $Status[2] Then
                $Status[2] = $Data
                _FileWriteLog($LogPath, "Status: " & @TAB & @TAB & $Data)
            EndIf
        EndIf
    EndIf
   
    If WinExists("Recycle Bin", " is corrupted. Do") Then
        ControlClick("Recycle Bin", " is corrupted. Do", 6)
    EndIf
EndFunc

Func AddHandler_FireFox()
    Local Const $KeyPath            = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\FireFox Cache"
    Local Const $Default            = "{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}"
    Local Const $Display            = "FireFox Cache"
    Local Const $Description        = "Cleans the firefox cache (FIREFOX MUST BE CLOSED)"
    Local Const $FileList           = "*.*"
    Local Const $CSIDL              = 0x1C
    Local Const $StateFlags0064     = 0x2
    Local Const $StateFlags         = 0x1
    Local Const $IconPath           = "%ProgramFiles%\Mozilla Firefox\firefox.exe,2"
    Local Const $LastAccess         = 0x0
    Local Const $DWORD              = "REG_DWORD"
    Local Const $EXPANDSZ           = "REG_EXPAND_SZ"
    Local Const $SZ                 = "REG_SZ"
   
    ;## Get the Path to the Firefox Cache folder
        Local $Folder = GetSpecialFolder(0x1C) & "\Mozilla\Firefox\Profiles\"
        Local $Search = FileFindFirstFile($Folder & "*.default")
       
        $Folder = "Mozilla\Firefox\Profiles\" & FileFindNextFile($Search) & "\Cache"
   
    ;## Add new Disk Cleanup Handler to the registry
        RegWrite($KeyPath, "",              $SZ,        $Default)
        RegWrite($KeyPath, "CSIDL",         $DWORD,     $CSIDL)
        RegWrite($KeyPath, "Display",       $SZ,        $Display)
        RegWrite($KeyPath, "Description",   $SZ,        $Description)
        RegWrite($KeyPath, "FileList",      $SZ,        $FileList)
        RegWrite($KeyPath, "Folder",        $SZ,        $Folder)
        RegWrite($KeyPath, "IconPath",      $EXPANDSZ,  $IconPath)
        RegWrite($KeyPath, "LastAccess",    $DWORD,     $LastAccess)
        RegWrite($KeyPath, "StateFlags",    $DWORD,     $StateFlags)
EndFunc

Func GetSpecialFolder($CSIDL)

    Local $Path = DllStructCreate("char Path[" & 0x104 & "]")
    Local $Dll = DllOpen("Shell32.dll")
   
    $result = DllCall($Dll, "int", "SHGetSpecialFolderPath", "hwnd", 0, "ptr", DllStructGetPtr($Path), "Long", $CSIDL, "int", 0)
   
    #cs http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx
        SHGetSpecialFolderPath Function

        Retrieves the path of a special folder, identified by its CSIDL.

        Syntax

            BOOL SHGetSpecialFolderPath(     
                HWND hwndOwner,
                LPTSTR lpszPath,
                int csidl,
                BOOL fCreate
            );

        Parameters

            hwndOwner
                Reserved.
            lpszPath
                [out] A pointer to a null-terminated string that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.
            csidl
                [in] A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
            fCreate
                [in] Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder will be created. If this value is zero, the folder will not be created.

        Return Value

            TRUE if successful; otherwise, FALSE.

        Remarks

            The Microsoft Internet Explorer 4.0 Desktop Update must be installed for this function to be available.
            With Microsoft Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
    #ce
   
    DllClose($Dll)

    If $result[0] = True Then Return DllStructGetData($Path, "Path")
   
EndFunc

Anyway, I hope someone finds it useful.

Edited by Zinthose

--- TTFN

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Very useful; was actually looking for this!

One quick question if I rewrite the reg entries to disabled/enabled will it work fine? for example all i need is clean

Temporary Internet Files

• Temporary Files -

• Temporary Offline Files -

• Internet cache -

Cheers

Edited by Donace

Share this post


Link to post
Share on other sites

Very useful; was actually looking for this!

One quick question if I rewrite the reg entries to disabled/enabled will it work fine? for example all i need is clean

Temporary Internet Files

Temporary Files -

Temporary Offline Files -

Internet cache -

Cheers

Thank you ;)

Yep, that's all you need to do.


--- TTFN

Share this post


Link to post
Share on other sites

can it clean Mozilla FireFox Temporary Internet Files, Temporary Files , Temporary Offline Files , Internet cache , etc?


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

can it clean Mozilla FireFox Temporary Internet Files, Temporary Files , Temporary Offline Files , Internet cache , etc?

As it is at the moment, no. It uses the Microsoft utility to perform the clean up. Thus it is unaware of Firefox, but a few registry entries will permit the utility to do as you suggest.

;## Here is were Firefox keeps the temporary files.
$FireFoxCache = "C:\Documents and Settings\" & @UserID & "\Local Settings\Application Data\Mozilla\Firefox\Profiles\"

I used this utility instead of writing my own from scratch because of it's modularity, familiarity, install base, and most of all it is conservative. The utility borders on the line of caution because Microsoft doesn't want fortune 500 companies calling with lawsuits that the utility deleted critical files.

That said, rbdietz posted a nice article here describing how you can add simple folder cleanup modules to the Disk Cleanup utility.

More advanced stuff is a bit more involved. See "CodeProject: Clean Up Handler" and "MSDN: Creating a Disk Cleanup Handler" for more info.


--- TTFN

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

can it clean Mozilla FireFox Temporary Internet Files, Temporary Files , Temporary Offline Files , Internet cache , etc?

Here is a script I wrote to add Firefox Cache to the Disk Cleanup utility.

AddHandler_FireFox()

Func AddHandler_FireFox()
    Local Const $KeyPath        = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\FireFox Cache"
    Local Const $Default        = "{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}"
    Local Const $Display        = "FireFox Cache"
    Local Const $Description    = "Cleans the firefox cache (FIREFOX MUST BE CLOSED)"
    Local Const $FileList       = "*.*"
    Local Const $CSIDL          = 0x1C
    Local Const $StateFlags0064 = 0x2
    Local Const $StateFlags     = 0x1
    Local Const $IconPath       = "%ProgramFiles%\Mozilla Firefox\firefox.exe,2"
    Local Const $LastAccess     = 0x0
    Local Const $DWORD          = "REG_DWORD"
    Local Const $EXPANDSZ       = "REG_EXPAND_SZ"
    Local Const $SZ             = "REG_SZ"
    
    ;## Get the Path to the Firefox Cache folder
        Local $Folder = GetSpecialFolder(0x1C) & "\Mozilla\Firefox\Profiles\"
        Local $Search = FileFindFirstFile($Folder & "*.default")
        
        $Folder = "Mozilla\Firefox\Profiles\" & FileFindNextFile($Search) & "\Cache"
    
    ;## Add new Disk Cleanup Handler to the registry
        RegWrite($KeyPath, "",                  $SZ,        $Default)
        RegWrite($KeyPath, "CSIDL",             $DWORD,     $CSIDL)
        RegWrite($KeyPath, "Display",           $SZ,        $Display)
        RegWrite($KeyPath, "Description",       $SZ,        $Description)
        RegWrite($KeyPath, "FileList",          $SZ,        $FileList)
        RegWrite($KeyPath, "Folder",            $SZ,        $Folder)
        RegWrite($KeyPath, "IconPath",          $EXPANDSZ,  $IconPath)
        RegWrite($KeyPath, "LastAccess",        $DWORD,     $LastAccess)
        RegWrite($KeyPath, "StateFlags",        $DWORD,     $StateFlags)
        RegWrite($KeyPath, "StateFlags0064",    $DWORD,     $StateFlags0064)
EndFunc

Func GetSpecialFolder($CSIDL)

    Local $Path = DllStructCreate("char Path[" & 0x104 & "]")
    Local $Dll = DllOpen("Shell32.dll")
    
    $result = DllCall($Dll, "int", "SHGetSpecialFolderPath", "hwnd", 0, "ptr", DllStructGetPtr($Path), "Long", $CSIDL, "int", 0)
    
    #cs http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx
        SHGetSpecialFolderPath Function

        Retrieves the path of a special folder, identified by its CSIDL.

        Syntax

            BOOL SHGetSpecialFolderPath(      
                HWND hwndOwner,
                LPTSTR lpszPath,
                int csidl,
                BOOL fCreate
            );

        Parameters

            hwndOwner
                Reserved.
            lpszPath
                [out] A pointer to a null-terminated string that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.
            csidl
                [in] A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
            fCreate
                [in] Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder will be created. If this value is zero, the folder will not be created.

        Return Value

            TRUE if successful; otherwise, FALSE.

        Remarks

            The Microsoft Internet Explorer 4.0 Desktop Update must be installed for this function to be available.
            With Microsoft Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
    #ce
    
    DllClose($Dll)

    If $result[0] = True Then Return DllStructGetData($Path, "Path")
    
EndFunc

*EDIT: Fixed a bug on line 23

Edited by Zinthose

--- TTFN

Share this post


Link to post
Share on other sites

have you updated the first post with your code of mozilla firefox cleaning?

I added Firefox support but haven't tested it yet.


--- TTFN

Share this post


Link to post
Share on other sites

good Afternoon

I copied this script and ran it but the error results

adlibEnable("_WindowsSearch",10)

^ERROR

Error : unknown function name 

=======================================

Can you advise. thanks 

Share this post


Link to post
Share on other sites

AdlibEnable has been replaced with AdlibRegister.  Below, AdlibDisable has been replaced with AdlibUnRegister.  Usage is the same.

BTW, I did not run the script to check for any other issues.

Ian


My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.

Share this post


Link to post
Share on other sites

ricksaul,

Please do not double post - I have deleted your other post with exactly the same question (which I had already answered). ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I ran this script, but commented out all the references to firefox because I use chrome. But it didn't seem to actually do anything. The disk cleanup utility breifly popped up then disappeared and then the script ended with exit code 512. So I re-opened disk cleanup and looked if any files were deleted and nothing had changed. 

I am on Windows 8.1 and Autoit v3.3.10.2

If you have suggestions please let me know, thank you guys. 

-Bryan

Share this post


Link to post
Share on other sites

Did you look to see if the disk cleanup process was actually running? What you describe is precisely what you should see, a brief popup and then it should run silently. You should be able to see it running in the Task Manager however.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hi Sorry for the late reply, I gave up on trying to make this work for Windows 8.1 back in May but now it's almost September and I'm trying to figure out if the script works. From what I can tell in about half a minute it will run silently, however when I open Windows disk cleanup utility there are a few files that are not cleaned and wondering if a registry entry would need to be written to clean them. Here they are as follows: 

Per user queued Windows Error Reporting

System archived Windows Error Reporting

System queued Windows Error Reporting

Debug Dump Files

Setup Log Files

System error memory dump files

Thumbnails

Using the RegWrite function i can get the checkbox checked for Thumbnails for example but the contents are not being deleted. 

Also the _FileWriteLog does not seems to actually write any log. Not sure why. 

Thanks if anyone is able to reply with some advice. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0