Log off & Standby in 1-Click ?

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 5,092
    Windows 7 32 bit
       #11

    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 Computer


  2. Posts : 1,781
    Windows 7 Professional SP1 32-bit
       #12

    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 Computer


  3. Posts : 189
    Windows 7 Home Premium 64Bits SP1
       #13

    Corazon said:
    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 Computer


  4. Posts : 25
    Windows 7 Ultimate 32bit
    Thread Starter
       #14

    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 Computer


  5. Posts : 5,092
    Windows 7 32 bit
       #15

    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 Computer


  6. Posts : 1,814
    XP / Win7 x64 Pro
       #16

    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 Computer


  7. Posts : 25
    Windows 7 Ultimate 32bit
    Thread Starter
       #17

    Thank you Fligi7 I will try later and report here!
      My Computer


  8. Posts : 5,092
    Windows 7 32 bit
       #18

    My guess would be once you log off, then there's no user with shutdown privilege. But it's just a guess.
      My Computer


  9. Posts : 25
    Windows 7 Ultimate 32bit
    Thread Starter
       #19

    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 Computer


  10. Posts : 5,092
    Windows 7 32 bit
       #20

    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 Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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:00.
Find Us