Thibstars icon

emptyRecycleBin

Thibstars | PRO | 05/26/16 02:11:01 PM UTC | 0 ⭐ | 307 👁️ | Never ⏰ | []
Batch |

780 B

|

None

|

0 👍

/

0 👎

@echo off
 
:ASK
SET /P IN=Are you sure you'd like to empty your entire recycle bins? [y/n]
goto CHECKIN
 
:ASKAGAIN
echo Wrong input, please type y/n as answer.
goto ASK
 
:CHECKIN
IF /I "%IN%"=="y" goto CLEARBIN
IF /I "%IN%"=="n" goto CANCEL
IF [%IN%]==[] goto ASKAGAIN
 
::Check input is exactly "y" or "n"
echo %IN% | findstr /r "^[^yn]*(y|n){1}[^yn]*$*" >nul 2>&1 && (echo []) || (goto ASKAGAIN)
 
:CLEARBIN
echo Emptying system recycle bin...
rd /s /q %systemdrive%\$Recycle.bin
echo Ready emptying system recycle bin!
echo Emptying desktop recycle bin...
rd /s /q D:\$Recycle.bin
echo Ready emptying desktop recycle bin!
echo ===================================
echo All recycle bins emptied!
goto END
 
:CANCEL
echo Canceled emptying recycle bin.
goto END
 
:END
pause

Comments