Forum Discussion
Keep running a script even when the system enters sleep mode
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").
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
- AFAIK, no... Your system is put to sleep because of that setting, causing everything to stop processing...
- LainRobertsonSilver Contributor
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