Let’s Make a Batch File to Clean Up Your PC
This tip will work on Windows 7, Windows 8, Windows 8.1 and Windows 10. So have at it!
Back in the days of yore — i.e. DOS — batch files were used by geeks to do all sorts of things – including some bad things. Batch files are still as powerful as ever. Geeks use them but that doesn’t mean they’re hard to create. Actually there are very easy to make. All you need to make one is Notepad, a little code, and a little patience.
So open Notepad right now. Press and hold down the Windows Key — then press the R key. In the command line type Notepad and press Enter. Now that Notepad is open copy and paste the following line (or if you’re a masochist you can type it all in):
Now, and this is VERY important! Make sure you select “All files” in Notepad’s Save as type dialog. If you leave it set as “Text Documents”- your batch file won’t work, because text files cannot execute. (See the helpful image below.)
Now that you have Save as type “All files” chosen, save your file as cleanup.bat . Saving it to your desktop is highly convenient because it’s right there where you can see it. Amaze your friends! Even your enemies! You are a geek – you just created a program!
Here’s another way to do it. This creates a shortcut to Windows Disk Cleanup – so it’s not so geeky but you can pin the shortcut your taskbar or Start menu if you choose.
Go to your desktop. Right-click on an empty area (one with no icons). Choose “New” then “Shortcut” and copy & paste this line of text:
Then click “Next” and give your Disk Cleanup Shortcut a name:
And click “Finish”.
If you want your shortcut to appear on your start menu or taskbar (or both), just right-click it and choose “Pin to start” or “Pin to taskbar” or both. See?
So whether you want to play around with making a batch file and amaze your cronies, or if you just want a nifty shortcut to clean up your computer, now you know how, right?