diff --git a/clear.bat b/clear.bat new file mode 100644 index 0000000..7a7c797 --- /dev/null +++ b/clear.bat @@ -0,0 +1,44 @@ +@ECHO OFF + +:: BatchGotAdmin +:------------------------------------- +REM --> Check for permissions +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" + +REM --> If error flag set, we do not have admin. +if '%errorlevel%' NEQ '0' ( + echo Requesting administrative privileges... + goto UACPrompt +) else ( goto gotAdmin ) + +:UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + exit /B + +:gotAdmin + if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) + pushd "%CD%" + CD /D "%~dp0" +:-------------------------------------- + +del /s /f /q %userprofile%\Recent\*.* + +del /s /f /q C:\Windows\Prefetch\*.* + +del /s /f /q C:\Windows\Temp\*.* + +del /s /f /q %USERPROFILE%\appdata\local\temp\*.* + + +/Below command to Show the folder after deleted files + +Explorer %userprofile%\Recent + +Explorer C:\Windows\Prefetch + +Explorer C:\Windows\Temp + +Explorer %USERPROFILE%\appdata\local\temp \ No newline at end of file