Log off & Standby in 1-Click ?

Page 3 of 3 FirstFirst 123

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

    Hhmm ok I'm going to make a new topic there and we will see if someone has an idea..
      My Computer


  2. Posts : 1,814
    XP / Win7 x64 Pro
       #22

    TheArt said:
    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.

    That makes sense. It's trying to run another command as you and you're not logged in, so it fails. If this didn't work, an AHK script won't either as they're both doing the same thing. I wonder if it would work if you could run it as System, which is the privileges you're running with at the login screen. This could get very hairy, though, if we try to go that route. I know you can get a process to run as System by scheduling it with Task Scheduler in Windows. So, in theory, you could create a scheduled task to run your .bat file, then create another .bat to call the scheduled task to run immediately via the schtasks or AT command, which would launch the process as System and run the commands. Of course, this is all assuming SYSTEM commands would still be issued after logoff. Might be worth a shot.
      My Computer


  3. Posts : 5,092
    Windows 7 32 bit
       #23

    I would guess the API was set up the way it was to try to avoid combining log off with the other functions. If it's a '0' you can't add it in. MS does some stuff by accident but I'm willing the give the benefit of the doubt it was deliberate. :)
      My Computer


  4. Posts : 1,814
    XP / Win7 x64 Pro
       #24

    Well, I think it has more to do with the simple succession of events rather than specific code attempting to prevent anything from happening after a logoff. The second command won't execute until the first completes. And, when the first completes, the user no longer has access on the system so it fails by design. This was the reasoning behind my wild idea of attempting to run the batch file as SYSTEM, given that SYSTEM has privileges while the user is logged in and still retains those privileges at the login screen after the user is logged out.
      My Computer


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

    Services run as System. That's why I suggested it be written as a service initially. I suppose there's no way to know for sure until someone writes or finds one that works.
      My Computer


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

    Update:

    Log Off & Standby automatically is almost possible, simply using Task Scheduler.
    Here there is the discussion : IDEA: Log off & Standby in 1-Click - DonationCoder.com
      My Computer

  7.    #27

    There are links for all kinds of shortcuts in Brink's tutorial if you scroll down to the bottom: Log Off Shortcut - Create
      My Computer


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

    gregrocker said:
    There are links for all kinds of shortcuts in Brink's tutorial if you scroll down to the bottom: Log Off Shortcut - Create
    Yes, creating an Abort Shortcut can be the solution to the first problem exposed in that topic but it will be a run against time because after the other user logs in he must press the shortcut otherwise the computer will go in standby mode anyway.
      My Computer


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

    I solved with the suggestions given me here: IDEA: Log off & Standby in 1-Click - DonationCoder.com
    Thanks MilesAhead !
      My Computer


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

    Glad you got it going. To people on DonationCoder running Windows7 with questions I'm always linking to tutorials and solutions here, and with Vista to the Vista sister forum. So it's a 3 way street. All are excellent resources. :)

    edit: for anyone trying to do the same thing, you should start reading the thread with this post:

    http://www.donationcoder.com/forum/i...6612#msg266612

    There are screen shots how to set up a Scheduled Task with logoff trigger. The posts that follow show how to Disable and Enable the task to avoid going into Standby on every logoff.
      My Computer


 
Page 3 of 3 FirstFirst 123

  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:07.
Find Us