November 23, 2024
powershell

Schedule Sleep to Your Windows Computer

Schedule sleep to your Windows computer. As you know powershell is strong tool in Windows operating system. I need to script as start sleep my computer on a spesific time.  And i wrote it.

You can schedule to your computer as shutdown easly there is many more option for that.  But if you want to sleep insted of shut your pc down there is not so alternative.

Here is the powershell script you can schedule sleep your computer. Just save it as ps1 file and run it when do you need to schedule sleep.

Powershell Schedule Sleep Script

Note: This command is not exact sleep mode. When you run the script, hibernate mode will on your computer (Consume very less energy). If you want to start your computer have to push power button (Not keyboard, mouse movement etc)

If you need to exact sleep mode instead of hibernate, you can do it with psshutdown.exe tool that tools of Sysinternals

Download From Here: https://technet.microsoft.com/en-us/sysinternals/psshutdown.aspx

  1. Put The PsShutdown.exe into C:\Windows\System32\
  2. Open your notepad and put the below command
  3. psshutdown.exe -d -t 0 -accepteula (The “-accepteula” Is To Accept The Terms Screen That Pops Up When Executing psshutdown.exe -d -t 0 )
  4. And Save Your notepad as cmd File (sleep.cmd)

Bir yanıt yazın