I’ve actually posted this tip before, if you’d like to read all of the details, view: Windows Tip: Automate Hard Drive Cleaning. In this version, I’ll also show you how to schedule this as a task.

Table Of Contents

This is the Second Step in the Fresh Computer Series.

Setup Automatic Hard Drive Cleaning

Download the two files below and save them to you Clean Machine folder (C:\Program Files\Clean Machine), just remember to save them file with a .bat extension. Also, if you’d like to make sure that there isn’t any malicious code (which I suggest, it’s your system – don’t trust anyone!), right-click the downloaded file and click Edit (or open them in Notepad).

Downloads

Run the “Automate Hard Drive Cleaning – Config” file. It will run Window’s Disk Cleanup utility and let you select what you want to delete. Whatever you choose here will be remembered every time you run the file (You can change these settings later if you choose by rerunning the Config file). I select everything except for the Recycle Bin. This way, if I need to recover a document, I still can.
Disk Cleanup Properties

Schedule The Task

  1. Navigate to: Control Panel -> Scheduled Tasks -> Add Scheduled Task
    (Alternately, you run this from the Run dialog: control schedtasks)
    Control Panel -> Scheduled Tasks -> Add Scheduled Task
  2. Hit Next in the dialog box that opens.
  3. In the Scheduled Task Wizard, navigate to the Automate Hard Drive Cleaning batch file:
    c:\Program Files\Clean Machine\Automate Hard Drive Cleaning.bat
  4. Click Next. Set this task to run Daily.
    Set The Task To Run Daily
  5. Click Next. Enter the time and date for the task. Set the Start time for 4:00 AM and Perform the task Every Day.
    Set The Time For The Task To Run
  6. In the next screen, enter in the username and the password for your Windows user account [1].
    Set Your Username And Password
  7. Hit Finish and you’re done!
    The Setup For The Scheduled Task Is Complete

[1] This user needs to be a System Administrator.

Next, we can proceed to Fresh Computer Series Step Three: Automate Hard Drive Defragmentation.