Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Log off & Standby in 1-Click ?

26 Oct 2011   #11
MilesAhead

Windows 7 32 bit
 
 

Also you can roll your own using AutoIt3 scripting language.

To go into Standby is trivial

Code:
If Not Shutdown(32) Then MsgBox(0x1010,"Error","Standby Failed!")
Exit



My System SpecsSystem Spec
.
26 Oct 2011   #12
Corazon

Windows 7 Professional SP1 32-bit
 
 

Power options... of course. Now I remember.

There is one setting in the advanced options for your active power plan, namely require password to be entered upon waking from sleep. I have that setting enabled.

I bet it's disabled for you...
My System SpecsSystem Spec
26 Oct 2011   #13
Manigue

Windows 7 Home Premium 64Bits SP1
 
 

Quote   Quote: Originally Posted by Corazon View Post
Power options... of course. Now I remember.

There is one setting in the advanced options for your active power plan, namely require password to be entered upon waking from sleep. I have that setting enabled.

I bet it's disabled for you...
Yes it is. Just checked it. Had forgotten about this setting.

Guess this explains the difference.
My System SpecsSystem Spec
.

26 Oct 2011   #14
TheArt

Windows 7 Ultimate 32bit
 
 

Thanks for all the replies, now I'll explain my situation better:
I have 2 accounts on this pc. My specs are quite low. So if the other account needs all the power but I only clicked the shortcut "Standby" my account remains protected by password, yes, but remains logged in -> with running programs. Instead logging off and then click standby resolves the issue.
In other words I would like to unite the Log Off button with the Standby one. Gadgets aren't the solution as I've seen. Writing some commands and then make an .exe can be the solution, but I have no idea how to do it.

Could anyone help?
My System SpecsSystem Spec
26 Oct 2011   #15
MilesAhead

Windows 7 32 bit
 
 

I think a difficulty may be if you log off, then the process that would ordinarily put you in Standby would stop running. The utility may have to run as a Windows Service.

I just looked at AutoHotKey Shutdown function. It's the same as AutoIt3 in that the code for logoff is 0. You add the codes together. Therefore there's no distinction between going into Standby and logging off first then doing Standby(which makes me think it's not possible using a normal app.)
My System SpecsSystem Spec
27 Oct 2011   #16
FliGi7

XP / Win7 x64 Pro
 
 

I think the difference here is the terminology you're using, which can be ambiguous. From what I gather, you're looking to shut down all programs and log off (like you're clicking the log off button) of your account and then sleep, rather than just suspend your processes and lock the desktop (like you're clicking Win + L shortcut) and then sleep. If this is correct, you can create a Logoff shortcut at the below link.

Log Off Shortcut - Create

I'm not sure if this will work, but you can create the above "logoff" shortcut, create the "sleep" shortcut as pointed to earlier in the thread, then create a .bat file that calls both. For example, if you create both shortcuts on your desktop, you would simply create a file called logoffandsleep.bat with the following:

Code:
rundll32 shell32.dll,ShellExec_RunDLL "C:\Users\YOURNAME\Desktop\Logoff.lnk"
rundll32 shell32.dll,ShellExec_RunDLL "C:\Users\YOURNAME\Desktop\Sleep.lnk"
However, I could very well see a problem with only the first logoff command being run and not the sleep command as once you're logged out and that command is completed you're no longer running in an area that might allow you to perform the sleep action via a script. But, it's worth a shot.
My System SpecsSystem Spec
27 Oct 2011   #17
TheArt

Windows 7 Ultimate 32bit
 
 

Thank you Fligi7 I will try later and report here!
My System SpecsSystem Spec
27 Oct 2011   #18
MilesAhead

Windows 7 32 bit
 
 

My guess would be once you log off, then there's no user with shutdown privilege. But it's just a guess.
My System SpecsSystem Spec
27 Oct 2011   #19
TheArt

Windows 7 Ultimate 32bit
 
 

I suspected that too, however I gave a try.
  • Created Sleep shortcut / created LogOff shortcut (with the tutorial on this site, also linked above).
  • Created the .bat with that two lines.
When I click on it, my pc logs off and doesn't go in sleep mode. So only the first line is executed as we thought.

My System SpecsSystem Spec
27 Oct 2011   #20
MilesAhead

Windows 7 32 bit
 
 

You could try on this forum:
Coding Snacks - DonationCoder.com

Please read the rules for Post New Requests Here subforum. The moderator on that forum is very good with AHK. He enjoys writing small utilities to order, which is the point of Coding Snacks. If you make clear the utility will likely need to be written as a service he can tell you if he can do it. There are "service wrapper" type programs that make it easy to configure things as a service but they might not be useful for this type of utility. The moderator is skwire.
My System SpecsSystem Spec
Reply

 Log off & Standby in 1-Click ?




Thread Tools




Similar help and support threads
Thread Forum
Left mouse click brings up right-click context menu continually
Hello, When I use my left click mouse button, the right click content menu keeps appearing. This happens often, but not everytime I click on the left mouse button. This is very annoying. I have gone into the Mouse Properties and the "Switch Primary and Secondary Buttons" box under the buttons...
Hardware & Devices
Weird Mouse problem, have to hold left click to perform right click
I just bought this mouse and I thought the right click was not working but found out that I had to hold left button to perform a right click. This is my first time encountering this problem and I don't know what to do. Please help. This is the mouse: Genius
Hardware & Devices
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 Id provide a consolidated How To on...
General Discussion
Laptop keyboard mouse:right click and left click functions reversal
Hi, I am after some help. My laptop has decided to reverse the right click and left click functions, ie: if I left click it now does not select but instead brings up a menu (which the right click button should and used to do!) I've tried holding down both buttons (as suggested by a friend) by this...
Hardware & Devices
Windows resumes from standby and goes to standby right away
I am an extensive Windows user but this problem has me totally confused. I have done lot of searching on web but cannot find a good answer. Windows 7 home premium, 64-bit HP Envy 3D laptop with 8GB memory, no custom hardware I have configured a backup job which wakes up the laptop at...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:03.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App