Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - PsShutdown & PowrProf.dll,SetSuspendState
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PsShutdown & PowrProf.dll,SetSuspendState

 Post Reply Post Reply
Lifeblood View Drop Down

Joined: 27 January 2012
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lifeblood Quote  Post ReplyReply Direct Link To This Post Topic: PsShutdown & PowrProf.dll,SetSuspendState
    Posted: 27 January 2012 at 8:34pm
I have a couple of questions about PsShutdown.

I wrote a custom batch file to put my computer into Standby using one of the different commands below.

start /min "" "C:\WINDOWS\System32\rundll32.exe" PowrProf.dll,SetSuspendState 0,0,0


start /min "" "C:\WINDOWS\System32\rundll32.exe" PowrProf.dll,SetSuspendState Standby, false, false


start /min "" "C:\WINDOWS\System32\rundll32.exe" PowrProf.dll,SetSuspendState Suspend, false, false

Using this any one of the methods above does put the computer into Standby, but any Scheduled Tasks that I have programmed to run WILL NOT run until I wake the computer manually.  Then they run as soon as I wake it up.

The third flag being set to 0 or false, is supposed to enable wake events, but is not doing so.

And, yes, I have them enabled on all of the tasks that I want to run.

If I put the computer into Standby with the sleep button on my keyboard, or use PsShutdown with the command below, it works beautifully.  It allows me to put my computer into Standby, and it WILL run all Scheduled Tasks.

psshutdown -d -t 0

So, here's my first question. 

What is my computer's sleep button, or PsShutdown, doing differently to put the computer into Standby so that it works?

My second questions is,

Why doesn't PowrProf.dll,SetSuspendState work?  Is there a glitch in the PowrProf.dll?  Or are there registry settings that are overriding the PowrProf.dll,SetSuspendState flags that I set?  If so, where in the registry are they? 

Are they located in one of these locations perhaps?

HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy

HKEY_USERS\.DEFAULT\Control Panel\PowerCfg\GlobalPowerPolicy

HKEY_USERS\S-1-5-18\Control Panel\PowerCfg\GlobalPowerPolicy

HKEY_USERS\S-1-5-19\Control Panel\PowerCfg\GlobalPowerPolicy

HKEY_USERS\S-1-5-21-853545766-1656268229-2807985563-1003\Control Panel\PowerCfg\GlobalPowerPolicy

I don't know if I'm on the right track or not, and even if I am, I don't know which bits of binary data to repair in those key values.

My third question is,

What is the difference between these PsShutdown switches?

-k          Poweroff the computer (reboot if poweroff is not supported)


-s          Shutdown without poweroff

I thought shutdown was always shutdown with power off?  Shutdown without power off is Standby, isn't it?

Anyway, I'd really appreciate any answers to my questions.

Back to Top
strues View Drop Down

Joined: 20 February 2013
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote strues Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2013 at 10:36pm
I encountered the same results... powerprof.dll would not allow a Windows XP PC's scheduled task to wake the PC from standby mode. The research i did seemed to indicate the hardware did not support wake from standby mode (the lower S1 or S2 standby mode i think). I was never able to get a conclusive answer as to what standby mode powerprof.dll put a Windows XP into, but like i said, i think it's S1 or S2 rather then the more common S3.
In any case, i also switched to psshutdown to resolve the problem. Unfortunately psshutdown doesn't seem to properly notify the OS of the pending switch to standby mode. So there is no event log entry and my application which tracks power savings doesn't think the PC goes into standby mode. Considering the age of XP, you're not likely to get much out of Microsoft or anyone else at this point. I have legacy XP in our environment which should be gone by the end of 2013. So i'm just biding my time until XP is gone. Win7 seems to work fine.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.06
Copyright ©2001-2016 Web Wiz Ltd.