SOLVED

Keep running a script even when the system enters sleep mode

Brass Contributor

Hello!

If I run a PowerShell script in a laptop and then, for example, I close the lid, the script execution is suspended. If I re-open the lid, the script execution resumes.

Is there a way to prevent this? Is it possible to force the script execution regardless of the status of the system?

 

The OS is Windows 11. In Control Panel -> Hardware and Sound -> Power Options -> System Settings it has:

"When I close the lid": Sleep (for both "On battery" and "Plugged in").

2 Replies
AFAIK, no... Your system is put to sleep because of that setting, causing everything to stop processing...
best response confirmed by Paige__Tanner (Brass Contributor)
Solution

@Paige__Tanner 

 

Harm is correct - that's a definite no, since the processor stops processing.

 

 

S3 is the default but can be modified via command line or group policy (the choices being restricted by what your hardware supports).

 

Cheers,

Lain

1 best response

Accepted Solutions
best response confirmed by Paige__Tanner (Brass Contributor)
Solution

@Paige__Tanner 

 

Harm is correct - that's a definite no, since the processor stops processing.

 

 

S3 is the default but can be modified via command line or group policy (the choices being restricted by what your hardware supports).

 

Cheers,

Lain

View solution in original post