Wednesday, February 17, 2010

Automating Maintenance

Now that we have our job user, what else can we do?  How many times do you hear, "Hey, my PC is running really slow.  Can you look at it?"  We all run through the simple things first, right?  So, you run defrag just to see how bad it is.  Upon realizing defrag hasn't been run since the day the machine was purchased you decide it's also prudent to do a chkdsk.  For the life of me I can't understand why these things aren't configured to run automatically.  I guess I should credit Windows 7 because it is scheduled to run every Wednesday at 1:00 AM on my laptop and I had nothing to do with it.  That said, my laptop is never on at 1:00 AM Wednesday ;)

Most of the PCs I support are still running Windows XP.  Try as I may people just don't have the money to upgrade.  So, as I get these requests for repair I always drop a couple of maintenance jobs on them.

Drag & drop defrag.exe on to the Task Scheduler and change the user to my job user a.k.a. Executioner.  In reality it's named something much more bland: job.user.  For real.  I set the schedule to run on Tue, Thr, Sat & Sun at 7:00 PM.  More on that in a moment.  You'll have to modify the command to include C: and -f (C-drive and force the defrag.)

c:\windows\system32\defrag.exe C: /f

I also schedule chkntfs.exe in the same way.  I only do this weekly on Sat & Sun at 11:00 AM.  chkntfs needs the parameters C: and /C to tell it which drive and to scan upon reboot.  That is quickly followed by a scheduled reboot (shutdown.exe) at 11:05 AM on the same days.  Shutdown needs /r /t 0 /f (reboot, wait 0 seconds and force).

c:\windows\system32\chkntfs.exe C: /C

c:\windows\system32\shutdown.exe /r /t 0 /f

I typically use Sat & Sun in my schedules because the systems can be off through the week depending on kids' functions, happy hour, etc. :P

Why early evening and weekend mornings?  In my next blog post, "What's Greener Than S3?" you'll find out.  Until then suffice it to say it's a good choice.  Of course, that's what I use for my PCs.  You can still use middle of the night times for family, friends and neighbors.

Tip: I have even scheduled the defrags of our servers disks in the middle of the night.  Servers need luvin' too ...


No comments:

Post a Comment