Make me a cmd script to clean my recycle bin everyday on Windows 11
- User
Make me a cmd script to clean my recycle bin everyday on Windows 11
- Assistant
You can create a CMD script to automate the process of emptying your recycle bin daily in Windows 11 by following these steps:
Step 1: Open Notepad Press the
Win+Skeys to search for Notepad and click on its icon to launch it.Step 2: Write the CMD script In the newly opened Notepad window, copy and paste the following code:
batch@echo off echo Emptying the recycle bin... powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -Command "Clear-RecycleBin -Force -Confirm:$false" echo Recycle bin emptied successfully.Step 3: Save the script Click on -> , then choose a location where you want to save the script (e.g., your Documents folder). Name the file and choose as the file type before clicking .