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 ?

27 Oct 2011   #21
TheArt

Windows 7 Ultimate 32bit
 
 

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


My System SpecsSystem Spec
.
27 Oct 2011   #22
FliGi7

XP / Win7 x64 Pro
 
 

Quote   Quote: Originally Posted by TheArt View Post
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 System SpecsSystem Spec
27 Oct 2011   #23
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
.

27 Oct 2011   #24
FliGi7

XP / Win7 x64 Pro
 
 

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 System SpecsSystem Spec
27 Oct 2011   #25
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
29 Oct 2011   #26
TheArt

Windows 7 Ultimate 32bit
 
 

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 System SpecsSystem Spec
29 Oct 2011   #27
gregrocker

 

There are links for all kinds of shortcuts in Brink's tutorial if you scroll down to the bottom: Log Off Shortcut - Create
My System SpecsSystem Spec
29 Oct 2011   #28
TheArt

Windows 7 Ultimate 32bit
 
 

Quote   Quote: Originally Posted by gregrocker View Post
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 System SpecsSystem Spec
30 Oct 2011   #29
TheArt

Windows 7 Ultimate 32bit
 
 

I solved with the suggestions given me here: IDEA: Log off & Standby in 1-Click - DonationCoder.com
Thanks MilesAhead !
My System SpecsSystem Spec
30 Oct 2011   #30
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
Reply

 Log off & Standby in 1-Click ?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Mouse double clicks when I click once and click when I hold it.
What I mean is that let's say I am trying to hold and drag a desktop file it will sometimes just click, making me drop the file on the spot. It will also double click when I try to make a single click. I tried to lower the settings for double click timing on the settings menu. EDIT: Tried out...
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
How do I change single click to double click to open emails?
WLM opens emails with a single click rather than just selecting the email. The boxes selecting double click to open are checked. This box is in the folders section and may be for folders ouyside of WLM. I want single click to select and double click to open emails. TIA
Browsers & Mail
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
Left click brings up right click context menu on desktop
For the last few weeks whenever I left click on the desktop it brings the right click menu. This dosen't happen in the browser (firefox), but only in the windows desktop and start menu. However i the browser if I am on a web player like youtube, the portion that displays the video fails to display...
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 16:15.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App