From 15db3118012a172a2191a2afad57084a65b34642 Mon Sep 17 00:00:00 2001 From: Clayton Errington Date: Wed, 16 Sep 2020 15:22:33 -0500 Subject: [PATCH] fix the recycling bin option (#32) * update the recycling bin option Powershell has a module in PS 5.1+ called Clear-Recyclebin that works better than the CMD method - rd /s %systemdrive%\$Recycle.bin * update recycling bin delete command one liner of ComObject in powershell instead of cmd asking for confirmation. adds better backwards compatibility. --- src/application/application.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application/application.yaml b/src/application/application.yaml index bbcb1176..41aa3e4c 100644 --- a/src/application/application.yaml +++ b/src/application/application.yaml @@ -384,7 +384,7 @@ actions: - name: Empty trash bin recommend: false - code: rd /s %systemdrive%\$Recycle.bin + code: Powershell -Command "$bin = (New-Object -ComObject Shell.Application).NameSpace(10);$bin.items() | ForEach { Write-Host "Deleting $($_.Name) from Recycle Bin"; Remove-Item $_.Path -Recurse -Force}" - name: Enable Reset Base in Dism Component Store recommend: true @@ -3347,4 +3347,4 @@ actions: code: |- del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat copy "%~dpnx0" "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat" - revertCode: del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat \ No newline at end of file + revertCode: del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat