@echo off
cd /d "%~dp0"
set "PS=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"
if not exist "%PS%" set "PS=powershell"
net session >nul 2>&1
if %errorlevel% neq 0 (
  "%PS%" -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
echo Will delete temp files, update cache and Recycle Bin.
set /p ok=Type Y then Enter: 
if /i not "%ok%"=="Y" exit /b 0
"%PS%" -NoProfile -ExecutionPolicy Bypass -Command "Get-ChildItem -LiteralPath '%~dp0' | Unblock-File -ErrorAction SilentlyContinue"
"%PS%" -NoProfile -ExecutionPolicy Bypass -File "%~dp0Clean-CDrive.ps1" -Execute
pause
