Home > Blockchain >  Is it possible to add a line to my script to prevent windows sleep during the job?
Is it possible to add a line to my script to prevent windows sleep during the job?

Time:12-06

I have a Batch file that works for me as intended. The only problem is that as jobs take sometimes a long time to complete, windows will go to sleep while the job is being done. I was wondering if it's possible to add a command to disable windows from sleeping and turn the option back when the job is done? Like adding powercfg /change standby-timeout-dc 0 at the beginning and powercfg /change standby-timeout-dc 20 at the end of the script?!

Anyway I will paste the script. Please take a look and see what is needed to be added to get this work:

@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "t0=%TIME%,            
  • Related