SHARE
TWEET

power_sleep

aveyo Apr 2nd, 2018 (edited) 369 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off &mode 32,2 &color cf &title Power Sleep
  2. set "s1=$m='[DllImport ("Powrprof.dll", SetLastError = true)]"
  3. set "s2=static extern bool SetSuspendState(bool hibernate, bool forceCritical, bool disableWakeEvent);"
  4. set "s3=public static void PowerSleep(){ SetSuspendState(false, false, false); }';"
  5. set "s4=add-type -name Import -member $m -namespace Dll; [Dll.Import]::PowerSleep();"
  6. set "ps_powersleep=%s1%%s2%%s3%%s4%"
  7. call powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -Command "%ps_powersleep:"=\"%"
  8. exit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top