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