From f272200c101707dfc5de0893edd6ccaddf9c77e8 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Sun, 25 Sep 2022 13:44:14 -0500 Subject: [PATCH] Delete Temp Files Addition --- winutil.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winutil.ps1 b/winutil.ps1 index d786174e..842b4451 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -536,6 +536,7 @@ $WPFInstallUpgrade.Add_Click({ $WPFdesktop.Add_Click({ $WPFEssTweaksAH.IsChecked = $true + $WPFEssTweaksDeleteTempFiles.IsChecked = $true $WPFEssTweaksDeBloat.IsChecked = $false $WPFEssTweaksDVR.IsChecked = $true $WPFEssTweaksHiber.IsChecked = $true @@ -556,6 +557,7 @@ $WPFdesktop.Add_Click({ $WPFlaptop.Add_Click({ $WPFEssTweaksAH.IsChecked = $true + $WPFEssTweaksDeleteTempFiles.IsChecked = $true $WPFEssTweaksDeBloat.IsChecked = $false $WPFEssTweaksDVR.IsChecked = $true $WPFEssTweaksHiber.IsChecked = $false @@ -576,6 +578,7 @@ $WPFlaptop.Add_Click({ $WPFminimal.Add_Click({ $WPFEssTweaksAH.IsChecked = $false + $WPFEssTweaksDeleteTempFiles.IsChecked = $false $WPFEssTweaksDeBloat.IsChecked = $false $WPFEssTweaksDVR.IsChecked = $false $WPFEssTweaksHiber.IsChecked = $false @@ -603,6 +606,13 @@ $WPFtweaksbutton.Add_Click({ $WPFEssTweaksAH.IsChecked = $false } + If ( $WPFEssTweaksDeleteTempFiles.IsChecked -eq $true ) { + Write-Host "Delete Temp Files" + Get-ChildItem -Path "C:\Windows\Temp" *.* -Recurse | Remove-Item -Force -Recurse + Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse + $WPFEssTweaksDeleteTempFiles.IsChecked = $false + } + If ( $WPFEssTweaksDVR.IsChecked -eq $true ) { If (!(Test-Path "HKCU:\System\GameConfigStore")) { Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_DXGIHonorFSEWindowsCompatible" -Type Hex -Value 00000000