1.

Solve : Will computer sleep while batch file is running??

Answer»

I'm trying to set up a batch file that will DEFRAGMENT my computer, create a time log when it finishes, and then shutdown. I'm wondering if my laptop will go to sleep during this process since it is set to sleep after 15 minutes of being IDLE when plugged in. If so, how can I prevent this so that the batch file can complete? This is my CODE so far and I'm running on Vista:

ECHO OFF
REM Defrag C: DRIVE, with full defrag and forced in nec.
START "" /WAIT %SystemRoot%\SYSTEM32\DEFRAG C: -W -F
REM Creating log file of time.
ECHO. |TIME > TIME
COPY LOG +TIME
REM Now shut down, forcing apps closed if necessary
START "" /WAIT %SystemRoot%\SYSTEM32\SHUTDOWN /S /F
:END

(If something doesn't seem right in the code, please let me know).

Thanks in advance!Sleep mode can be a bit unpredictable (and unreliable) at times, so it's hard to say for sure, but I would say that it should still go into sleep mode.  I don't think it'll interfere with your batch, but I suppose it could depending on your settings, so the best way to find out is to simply test it.

Or if you'd rather not go through the trouble, you can disable Sleep/Stand By through the Power Options in your Control Panel.Thanks for the response! I will test it. Be sure to let us know how everything goes.To ANYONE
How do you set up the generated defrag file so you can select it after creating the file. Complete sequence please. I am not to swift on creating app files.
Russ



Discussion

No Comment Found