In case if anyone else is interested in automatic defrag on Windows 2000 systems, Here is sample JAL script that can used to automate MMC snap-in You can paste it to JAL script job. Replace "d:" with the desired drive name. Dim pid, number Dim win, number Run "mmc c:\winnt\system32\dfrg.msc /d:", "", pid WindowWaitOpen "Disk Defragmenter", 10 WindowFind "Disk Defragmenter", win WindowActivate win SendKeys "{ALT}AD" WindowWaitOpen "Defragmentation Complete", 0 WindowFind "Defragmentation Complete", win WindowActivate win SendKeys "{TAB}{ENTER}" WindowWaitClose "Defragmentation Complete", 0 SendKeys "{ALT}C" : You can schedule defrag.exe or similar utility. Depending on your Windows : version name of the command may different : On XP, 98, Me, 95 it is "defrag.exe" : On W2K (also supported on XP) it is "mmc dfrg.msc" or whatever the : saved console name is. : For example, you could schedule the following command: c:\windows\defrag.exe : c: /noprompt /q : For more info on supported command line options run : "help defrag" or "defrag /?" : On some systems the defragger is not installed by default, you may need to : add it from the Windows setup files.
|