sf:
Unfortunatly the Wizard that XP provides doesn't actually give you the
funcationality that you'd want for this use. It doesn't actually give you a
clue to that, thuough (another unfortunate useability mistake). Anyway, let
me first let you know about the username and password issue. The tasks are
going to be able to be run by anyone, and modified by anyone with Admin
priviliges. The tasks will automatically run at the specified time no matter
who is logged on, or even if nobody is logged on (on the logon screen). It
needs a password to know which user's space to start the program in. It's
almost identical to using the "Run As..." option for a program. So for
instance, if you schedule defrag, and then use a limited user's name and
password, the defrag won't run, because the user it's trying to "run as"
doesn't have the authority to defrag a disk. Like I said, this won't
restrict anyone else from seeing/modifying/running the task manually.
Now about scheduling the cleanup or defrag.
-- Step 1: Don't use the Add Scheduled Task Wizard.
I know this seems dumb, but -- trust me. (Short reason, that will launch
the defrag GUI, which can't be scripted, so it'll only open the program, then
do nothing until the time alloted for the task expires, then XP will force it
to exit.)
-- Step 2: Right-click in the Scheduled Tasks folder, point to New >, then
click Scheduled Task. Name the task "cleanup c" or "defrag" or something.
Then double-click it to open it.
-- Step 3: For defrag, type "defrag c: /f /v" in the first feild, where c:
is the drive, obviously. The /f flag forces XP to defrag the disk even if it
doesn't "think" it's needed. Note that it must be quite bad before XP
decides it's needed. The /v flag enabled verbose output. You can remove it
if you prefer, then when the task is running, you'll only see a CMD window
with the defrag program copyright information, but no true information about
the process or status of your disk.
In the "Run As:" box, it should be pre-loaded with your Windows user name.
Click "Set Password..." and type your Windows password twice.
Set the Schedule tab however you want. I have mine defrag once a week early
Monday morning at 4:00am.
On the Settings tab, again set the options you want. I have mine set to
allow defrag to run for up to 4 hours. It usually finished in about 8
minutes though, and exits long before time runs out. The only other option I
have turned on is to "Wake the computer to run this task." This way I can
enable Power Saving sleep settings, without causing the computer to miss this
task.
-- Step 4: If you chose to schedule clean up, here's how:
First, put this in the Start Menu, Run box: "cleanmgr /sageset:10" (replace
ten with any digit you want up to (65000 or something, I can't remember... I
use 777, just because that's my favorite three-digit number, ha ha). Anyway,
when you "run" that command, you'll get a familar disk-cleanup screen. Check
the sections you want to have cleaned up automatically. Remember this will
happen automatically -- you may not want the Recycle Bint to be emptied
without your explicit consent, but then, it wont' hurt anything to clear temp
files automatically. So set them how you want, then click OK. Nothing
actually gets cleaned up right now. This saves those settings to the
registry. You can do ths more than once using another digit in the command,
and set each sets own settings. I don't, but you can.
Next, make a new task the same way as you did above. In the run box, put
"cleanmgr /sagerun:10" (or whatever number you chose last time.) This will
make it use the stored settings. Again, set a password so it has the
authority to run this task as if you did it manually, then set a schedule and
settings. I use a weekly settings for this as well, and have it run at
2:45am, so it can run and finish before defrag runs a few hours later.
Good luck and happy... defragmenting. Ha ha.
___________________
Shawn