batchfile for win2k to run defrag, scandisk/chkdsk and NAV in sequence

mOrphine

Senior member
Apr 30, 2000
638
0
0
i used to have this batch file for win9x that would run the said programs in sequence, sorta my weekly maintenence regime, just have to run the batchfile, have lunch and come back to the computer(hopefully "maintained").

is it possible to do this in win2k? i havent been able to find the commandline options for scandisk/chkdsk(actually, havent been able to find the .exe responsible for scandisk in win2k either). if someone knows the commandline options for diskeeper too that would be great <G>

i dont want to run a 3rd party scheduling program if i can help it.

thanx in advance <G>
 

TBP

Senior member
Feb 20, 2000
919
0
0
Can you just use the default scheduler in win2k? -just a thought
 

mOrphine

Senior member
Apr 30, 2000
638
0
0
i was under the impression that schedulers such as the default one in win2k or 3rd party ones schedule programs to run according to a given time?

with the batch file i had in win9x, i got the programs to run in sequence, ie, defrag would run first, exit, scandisk would run, exit and finally NAV would run.

i would like the option of running the batchfile when i want to by double clicking on it, as opposed to running at a given time(which is wat i thot schedulers do), which might be in the middle of a cd-burning session ;)
 

jaywallen

Golden Member
Sep 24, 2000
1,227
0
0
Hi, mOrphine. You may wish to alter the way you accomplish these jobs just a bit in W2K. Let me explain why.

CHKDSK (There is no Scandisk in W2K.) will only run at boot time on the active OS partition (whichever one you're booted on). So, right there, you've got a situation where you open a command prompt, and type &quot;chkdsk /r&quot;. CHKDSK will tell you that it can't get exclusive access to the drive (because, after all, the OS and its services are running), and it will ask you if it's okay to run the next time you boot. You tell it yes, and then it'll do its thing the next time the system boots.

AFAIK, the built-in defragger can't actually be scheduled to run automatically using the W2K scheduler without using a workaround. I know the workaround is out there somewhere, but I don't know where. I never bothered to pay attention because I use a third party defragger: Executive Software's Diskeeper on servers and O&amp;O Defrag Pro on notebooks.

A NAV or other anti-virus scan on the system can be run on a schedule either using its own built-in scheduler or the Windows 2000 scheduler.

If your defragger is operable by issuing commands at a command prompt, and if your third party defragger is similarly operable from the command line, then you can use a script to run them manually (or you can schedule the script).

Even chkdsk can be run by script, so you could combine all three functions in a script (which is like a batch file) provided that the executables you're using meet at least the requirements I gave above.

You'd have to investigate scripting and the &quot;AT&quot;, &quot;NOW&quot; and &quot;SOON&quot; commands, or something along those lines, to do exactly what you're talking about. It's a bit more complex than a batch file. And possibly not worth it since you can accomplish the same thing using the GUI tools available to you. Just requires a slight change in the way you do things. BTW, unless your drive is really small, I wouldn't count on all three of those operations being done by the time you get back from lunch -- unless you get some really nice lunch breaks! :D

Regards,
Jim