PDA

View Full Version : Defragment and shut down


mnovak5
06-12-2001, 05:54 AM
Hi!
I'd like to run defragmentation of the disk in the evening and leave the computer. Plus let the machine switch off itself when the defragmentation is done.
I know there is a program to do this - "DefragToShutdown" or the like but I'd like to have a abtch file (no more utilities that do simple things you can do yourself!)
I tried to write a batch file but since I'm not an expert, it doesn't work. I tried the following:

%windir%\defrag.exe (and numerous variatitons)

rundll32.exe .... (the usual call for switching off the computer)

When I run the batch file, it does't execute anything, tells an error on the first line and proceeds to the next one - shuts down the computer.
Where's the problem???

prasad
07-10-2001, 03:49 PM
Try to use WScript.Run method