ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: Log off & Standby in 1-Click

(1/5) > >>

TheArt:
Hi all I've an idea: Create a something that makes your computer logging off and then puts it in standby mode.
In my situation this could be very convenient.
Currently to do that we have to do the following (win7): Start -> Click white arrow next to ShutDown button -> Click log off -> Wait to the main menu where all the accounts are displayed and click on the red arrow below right -> Finally click Standby.
I tried to do that creating two shortcuts on my desktop called LogOff and Sleep, and after creating a .bat file with this lines:

rundll32 shell32.dll,ShellExec_RunDLL "C:\Users\YOURNAME\Desktop\Logoff.lnk"
rundll32 shell32.dll,ShellExec_RunDLL "C:\Users\YOURNAME\Desktop\Sleep.lnk"
--- End quote ---

But as I supposed it executes only the first line, so this isn't the solution.

Thanks in advance  8)

MilesAhead:
Glad to see you made it over from Win7 Forums. :)

I suspect that as soon as you log out, there's no user with shutdown privilege. For that reason I suspect it would have to be written as a service. Since the API call uses 0 as the code for log off I'm wondering if that was done deliberately to prevent doing this.

But I don't know that for sure. I haven't written any services so perhaps someone with Windows Services experience can chime in if it's doable.

4wd:
You could try running the Sleep command as a Scheduled Task set to run after the user logs out.

That should run the Sleep command at the SYSTEM level - you might need to set this in the Task, (W7 you can set highest privilege).

If there isn't a specific trigger for user logoff, then look at the event log and find the specific event - you can then set that in the Task, (I do this to rerun programs that don't like being restored from Sleep/Hibernate).

MilesAhead:
If it's set up that way won't it sleep on every logoff? Or can you tune it?

MilesAhead:
I found this workaround:

http://www.vistax64.com/vista-general/53254-shortcut-logoff-then-put-pc-sleep.html

Sleeps, then logs off when you restart.  Nice simple solution, if it does what you want. :)

Navigation

[0] Message Index

[#] Next page

Go to full version