Saturday, September 18, 2010

Automating Disk Cleanup

Windows Disk Cleanup is a task that should be performed periodically to eliminate clutter. You may occasionally remember to run this program, but how often do you really do it. Did you know it can be scheduled?

Without too much hassle Disk Cleanup can be scheduled with Windows Scheduler, but it will only load, calculate how much space can be freed, and wait for user input. And a scheduled program that loads and waits for input isn't much help. But wait! There's more!

Did you know you can establish a set of rules that tells Disk Cleanup what you want cleaned and that it can be scheduled to run automatically without any user input? It's true.

I'll show you how it's done, but you might first want to have a look at the knowledge base article on this subject.

Got that? I thought so. Here's how it's done:

Establish the Rules
The first thing we're going to do is tell Disk Cleanup what to do when it runs.

1. Click Start, Run and type in the following to clean the C: drive:

cleanmgr /d c: /sageset:xxxxx

[Substitute xxxxx for any number from 0 to 65535]

Example:

cleanmgr /d c: /sageset:11

A Disk Cleanup Settings dialog box similar to the one below will be displayed.



2. Work your way down the list and check the types of files you want deleted. When you're done click okay.

3. Test your settings by running Disk Cleanup using the Run … command:

cleanmgr /sagerun:xxxxx

[Substitute xxxxx for the number you used in /sageset:]

Example:

cleanmgr /sagerun:11


Review: Disk Cleanup Parameters
Here's what we've learned so far.

a. You can run the Disk Cleanup program by clicking on Start, Run… .

b. You can establish a set of rules using the /sageset:xxxxx parameter.

c. The xxxxx can be any number between 0 and 65535.

d. You can specify what drive will be checked using the /d drive letter: option.

e. If you don't specify the drive letter option Disk Cleanup will be run on all the computer's drives.

f. You don't need to specify the drive letter with the /sagerun parameter because it was already specified with /sageset.

g. When you run Disk Cleanup with the /sagerun:xxxxx parameter you must use a number previously set with the /sageset:xxxxx parameter

h. You can establish 65,536 sets of Disk Cleanup rules on one computer. Far more than we actually need.

Scheduling the Task
Now that you're satisfied with the results of an automated Disk Cleanup you can set up the Scheduled Task to run weekly.

1. Go to the Control Panel and open Scheduled Tasks.

2. Double-click Add Scheduled Task to begin the Scheduled Task Wizard. Click Next to continue.

3. Scroll down the list until you see Disk Cleanup. Select it and click Next.

4. Name the Task or leave it as is and click on the radio button next to Weekly. Click Next to continue.

5. Select the time of day and the day(s) of the week you want this task to run. When you're done here click Next to continue.

6. Enter and confirm the password you have set for yourself on this computer. Click Next to continue.

7. Check the box to open advanced properties and click Finish. This will open the property sheet for the task. Note: If you forget to open the advanced properties at this point just locate the task in your task list, right-click and select Properties.

8. In the Run: text box you will see the command to run Disk Cleanup. Type in the /sagerun:xxxxx at the end of the command leaving a space between the end of the command and the /sagerun parameter. Substitute xxxxx with the number you used earlier when setting the Disk Cleanup rules.

Example:

C:\WINDOWS\system32\cleanmgr.exe

Becomes:

C:\WINDOWS\system32\cleanmgr.exe /sagerun:11

9. Ensure that Enabled is checked. Otherwise the Task won't run as scheduled.

10. Click the Settings tab.

11. Check the Wake the computer to run this task checkbox to ensure the computer will come out of standby when it 's time to run this task.

That's it; we're done. You can check the results by returning to Scheduled Tasks and checking the dates and run times in the Next Run Time and Last Run Time columns.

Tuesday, September 14, 2010

Garage Music Revisited

There are basically two requirements for trying to get older technology to perform today's tasks; time and patience.

I finally allowed myself the time to set up an old laptop computer in the garage to play music streamed from my network attached storage device. As for the patience, read on.

The computer is over 10 years old and it takes forever to load a Windows operating system, but it's only being asked to do one task - play music - and right now it's doing that better than my old PDA was. With old technology come comparisons to new technology. I quickly realized I have flash drives with more space than the computer has memory or disk space. Yet it manages to quickly come out of standby, connect to the network by way of an ancient Netgear MA401 802.11b PCMCIA card, and load iTunes.

It may not be the best way to access the music server and play iTunes, but it was all cobbled together from unused gadgets I had laying around the house, and it gives me a great deal of satisfaction knowing that I'm resourceful enough to more fully utilize my technological investments.

BTW, I did try a Puppy Linux Retro v.4.1.2 installation on an alternate hard drive before deciding to stay with Windows. A network connection was established, but couldn't be maintained after subsequent reboots probably due to our hidden SSID. I also had a problem getting Firefly Client to work. The Puppy distro did not include the Java JRE, and getting it installed and working with all its dependencies was too time-consuming.

I threw in the towel after several hours and dozens of time-consuming reboots on the ancient laptop because I already had Windows working. As I mentioned at the top of this post, time and patience are required when attempting to adapt or repurpose older technology, and there comes a time on every project when you have to know when to switch tracks and go with what you know will work.

What matters most is the end result, the finished product, the bottom line. And to that end I have my very groovy tunes to look forward each time I work in the garage. That's my story and I'm sticking to it.