diff --git a/Cleanup-SystemTempFiles.ps1 b/Cleanup-SystemTempFiles.ps1 index 8be4b0c..5ab3bbd 100644 --- a/Cleanup-SystemTempFiles.ps1 +++ b/Cleanup-SystemTempFiles.ps1 @@ -75,6 +75,11 @@ If ( IsAdmin ) ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue } } } + + # Silently run cleanmgr.exe with default settings + LogMsg "Running cleanmgr.exe with default settings" + Try { Start-Process "cleanmgr.exe" -ArgumentList "/VERYLOWDISK" } + Catch { LogErr $_.Exception.Message } } # Only run this section if we don't have administrative privileges @@ -98,4 +103,9 @@ Else ForEach ( $tempfile in $AutoCADTempFiles ) { Remove-Item $tempfile -Force -ErrorAction SilentlyContinue } } } + + # Silently run cleanmgr.exe with default settings + LogMsg "Running cleanmgr.exe with default settings" + Try { Start-Process "cleanmgr.exe" -ArgumentList "/VERYLOWDISK" } + Catch { LogErr $_.Exception.Message } }