You Can Make a Batch File (or Shortcut) to Clean Up Your PC

By | June 11, 2018

You Can Make a Batch File to Clean Up Your PC… Yes You Can!

First things first” This tip will work on Windows 7, Windows 8.1 and all versions of Windows 10. So, my friends, 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 but don’t forget the space after exe and before the slash…):

c:\windows\system32\cleanmgr.exe /dc

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.)

Cloudeight InfoAVe

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 real Windows program!

Not a geek? Here’s another way to do it. This creates a shortcut to Windows Disk Cleanup. It’s not as geeky but you can pin the shortcut your taskbar or Start menu if you choose. Click the shortcut and run Windows Disk Cleanup. Just like that!

Ready. Press Windows Key to go to your desktop. Right-click on an empty area of your desktop (i.e. not on an icon 🙂 ). Now choose “New” then “Shortcut” and copy & paste the following line:

c:\windows\system32\cleanmgr.exe /dc

"Cloudeight
Then click “Next” and give your Disk Cleanup Shortcut a name:

"Cloudeight
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?

Cloudeight InfoAve Windows Tips

Soooo… whether you want to play around and make a batch file and amaze your cronies with your computer savvy, or if you just want a handy shortcut to clean up your computer,  you now know how, right?

That’s a rhetorical question, EB. They don’t need to answer it.

2 thoughts on “You Can Make a Batch File (or Shortcut) to Clean Up Your PC

    1. infoave Post author

      Reg Organizer has a disk cleanup feature too. But Reg Organizer is not free and not everyone has it. Windows Disk Cleanup has been on every version of Windows since Windows 95 so this was a reminder as well as a learning tip.. Even those with disk cleaning programs may not always want to fire up a complex program just to clean temp/junk files.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *