JLRoberts Posted September 27, 2004 Report Share Posted September 27, 2004 Hello All, I am a new user of Macro Express 3.0f. I need a macro to work on a Win2000 client PC that will defrag the C:drive and when finished perform a shutdown. I note from Microsoft Knowledge Base 318759 that the defragger cannot be scripted or scheduled. Is this job too much for Macro Express? TIA JLRoberts Quote Link to comment Share on other sites More sharing options...
kevin Posted September 27, 2004 Report Share Posted September 27, 2004 Macro Express certainly has the commands necessary to perform this task. However, whenever the defragger is running, if other programs are also running, the Windows defrag program puts up a warning message and starts the defrag over again. This may be the reason that Microsoft says "the defragger cannot be scripted or scheduled." However, I suggest you try it and see what happens. If you have trouble with the defragger starting over, then you will need to try some tricks. For example, if you put Macro Express 'to sleep' during the duration of the defrag then the defragger should not start over. To do this, try the 'Wait Time Delay' or 'Wait Time Elapse' macro commands. These commands tell Windows to suspend Macro Express for a period of time. The challenge is that you will need to make an educated guess as to how long to put Macro Express to 'sleep'. You do not want Macro Express to wake up until the defrag process is complete. So, if your defrag process takes two hours, put Macro Express to sleep for 2.5 hours or so after launching the defrag process. Then, when Macro Express 'wakes up', it can perform the shutdown. You could write the macro so that after Macro Express 'wakes up' it determines if the defragger is still running and if so, go back to sleep for a longer period. The longer period would allow the defragger to start over and have more time to finish. If you keep a log (using the Log Messages command), the next day you can see when the macro performed certain steps (by examining the log file). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.