Defrag and Disk Cleanup Utils automated in Task Scheduler

G

Guest

My apologies if there's an MS.com article on this, but I'm having trouble finding out how to getting a scheduled task to do anything more than merely open the program. I'm currently trying to automate tasks such as Defrag and Disk Cleanup monthly on a couple of XP Pro boxes, but using the Scheduler wizard, it merely opens the program and waits for user input. I've found articles suggesting that I should use Defrag.exe with switches, rather than Dfrg.exe, but it's not clear how to use the switches in Task Scheduler. My assumption is that scripting is involved for both of these cases. I'm interested in pursuing this route, as I've not done any command line scripting before, and this would be a great way to learn. Does anyone have any pointers to more info about this, or merely a solution to my problem? :) Thanks heaps

Jason Bennett
 
M

MAP

-----Original Message-----
My apologies if there's an MS.com article on this, but
I'm having trouble finding out how to getting a scheduled
task to do anything more than merely open the program.
I'm currently trying to automate tasks such as Defrag and
Disk Cleanup monthly on a couple of XP Pro boxes, but
using the Scheduler wizard, it merely opens the program
and waits for user input. I've found articles suggesting
that I should use Defrag.exe with switches, rather than
Dfrg.exe, but it's not clear how to use the switches in
Task Scheduler. My assumption is that scripting is
involved for both of these cases. I'm interested in
pursuing this route, as I've not done any command line
scripting before, and this would be a great way to
learn. Does anyone have any pointers to more info about
this, or merely a solution to my problem? :) Thanks heaps-
Jason Bennett
.
Hi Jason,Hope this helps

http://www.informationweek.com/story/showArticle.jhtml?
articleID=15600170
 
J

John

Yeah, I just went through this. The short answer is open notepad and
type the following:
defrag.exe c: (where "c:" is the appropriate drive letter)
cleanmgr.exe /sagerun:n

Save it and change the extension from .txt to .bat. Voila! You've made a
batch file.

Now the important part. Get to the command prompt (Start>Run and type
cmd) and type "cleanmgr.exe /sageset:n", which will give you a dialogue
box. Make the appropriate clean up settings. Schedule your batch file
and you're done.

BTW- MAP posted a good, informative link. I read it twice. :)

BTW- More good info, thanks to Carey Frisch [MVP]:
1. Open XP's "Help and Support" program.
2. In the Search box type: COMMAND-LINE , and hit enter.
2a. Click on "Managing System Information from the command line"
3. Then click on "Command-line reference A-Z".

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top