New
#1
Automatic Sleep following Logoff (AKA One-click Log off & Standby)
This topic had been covered before in another thread posted last year, but the solution referred to still required me to do a fair bit of digging and playing to be able to get it to work as I wanted. So, to help others that may want to do the same, I thought I’d provide a consolidated “How To” on this. Since I’m a novice to most of the techniques used here I’ve covered the basics for those who may be in the same position - so for you experts out there please forgive the sound of sucking eggs!
There is one caveat to this solution – I was hoping that this post would be providing a complete solution. There is however one niggle that I don’t have an answer to and am requesting suggestions. See the last section below.
The “Problem”
I have a home PC (running Windows 7 Pro 64) with four accounts (each without passwords). I want to have the PC to go into Sleep most of the time instead of Shutting Down. If, from one of the accounts, you put the PC into Sleep then, when it wakes, it does not present the normal Logon screen with all accounts - it just shows a logon for the last account (which is logical since you may have had programs open). However, if it’s not the account you want, you have to go into the account, logoff and then go into the account you want (or switch user).
The Logoff and Sleep can obviously be done by logging off and then selecting Sleep from the options on the login screen. But I find that this two-click process is far too much effort and I was keen to find a single click solution! I was also keen to find a solution that did not use any third party utilities.
To me this function makes absolute sense. Why would you want the machine to sit there in the logon screen without going into a power saving mode almost immediately. And as far as I can see there’s no way of setting the power saving mode for the logon screen separately.
Credit Where Credit’s Due
As I mentioned, this had been covered in a previous thread on this forum:
https://www.sevenforums.com/general-discussion/193750-log-off-standby-1-click.html
Which had a link to:
http://www.donationcoder.com/forum/index.php?topic=28490.msg266669#msg266669
And credit to this solution really goes to 4wd and other contributors on that forum.
The Principle
I had a couple of problems with the solution as defined in those threads. First, it had a prerequisite that the user account had a password and, secondly, it required the use of a shortcut on the desktop to perform the Logoff/Sleep function rather than using the normal Logoff function from the Shutdown button. So I’ve refined it a bit.
The basic principle is to use Task Scheduler to set a task to force the computer to go into Sleep 30 seconds after someone logs off. It also has a task that kills the automatic Sleep if another user logs on within the 30 seconds (this is the main refinement since the previous solution was to use batch files to enable and disable the task).
If passwords are not used then the set up of the tasks requires you to disable the password requirement using the Local Administrative Tools
And finally, you have to completely disable Hibernation. Without doing this then the PC will go into Hibernation instead of Sleep.
The Process
The process to set this up takes a few minutes and requires the following five steps (which are detailed in the attached PDF):
1. Disable Hibernation
2. Disable Password requirement for the Tasks (if passwords not used)
3. Set Up a Task for Delayed Sleep triggered from a logoff (LogoffSleep task)
4. Set up a Task to Kill the LogoffSleep task if someone logs back in (LogoffSleepKill task)
5. And, if you want, change the default Shutdown button to Logoff
So, if you want to try the Logoff/Sleep function, follow the instructions and test it out. Then feed back any issues – although I doubt if I’ll be able to come up with the answers but I’m sure there’ll be others here who will be able to help!
And a few questions for the experts
The niggle I have with the set up described here is that if you have to do a shutdown to install updates, the computer logs itself off and then hangs on the log-off screen whilst it does the updates – this can invariably take longer than 30 seconds. The computer will therefore be forced into a sleep during this update. Now this has happened to me and when you wake the computer up it appears to complete the update without apparent complaints. What I would really like to know if there is any way of detecting that this is happening and prevent the sleep kicking in. I could resort to using a batch file to disable the Task before doing the shutdown but it's not very elegant (since you'll then ahve to re-enable it (can you use a task to enable another task? If you can then you can use this to enable it at logon))
Also, can any of you see other issues with the process describe here? Specifically any issues related to disabling the password requirement for the scheduled tasks. There’s obviously a chance that if, once someone’s logged out, there’s a delay in another person logging on there’s slim chance that the LogoffSleep task could be triggered half way through the login process and just before the LogoffSleepKill task stops it. It’s a remote possibility but do you think this would be an issue?
And finally, some information I could not track down was a list of all Event IDs for Winlogon process or any specific reference info for powrprof.dll. If anybody can oblige I’d appreciate it.
_