Solved Log off & Standby in 1-Click ?

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

My Computer My Computer

At a glance

Windows 7 Ultimate 32bitCore 2 E67502gbNVIDIA GeForce 210
OS
Windows 7 Ultimate 32bit
CPU
Core 2 E6750
Motherboard
ASUS P5KPL
Memory
2gb
Graphics Card(s)
NVIDIA GeForce 210
Sound Card
Creative Audigy 2 ZS
Monitor(s) Displays
Philips 17''
Screen Resolution
1280x1024
Keyboard
Logitech K300
Mouse
Logitech M500 Corded Mouse
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 My Computer

At a glance

XP / Win7 x64 ProIntel Quad-Core Q9450 @ 3.2GHz2x2GB GSkill DDR2NVIDIA GeForce 8600 GTS (EVGA)
OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
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 My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
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 My Computer

At a glance

XP / Win7 x64 ProIntel Quad-Core Q9450 @ 3.2GHz2x2GB GSkill DDR2NVIDIA GeForce 8600 GTS (EVGA)
OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
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 My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.

My Computer My Computer

At a glance

Windows 7 Ultimate 32bitCore 2 E67502gbNVIDIA GeForce 210
OS
Windows 7 Ultimate 32bit
CPU
Core 2 E6750
Motherboard
ASUS P5KPL
Memory
2gb
Graphics Card(s)
NVIDIA GeForce 210
Sound Card
Creative Audigy 2 ZS
Monitor(s) Displays
Philips 17''
Screen Resolution
1280x1024
Keyboard
Logitech K300
Mouse
Logitech M500 Corded Mouse

My Computer My Computer

At a glance

Windows 7 Ultimate 32bitCore 2 E67502gbNVIDIA GeForce 210
OS
Windows 7 Ultimate 32bit
CPU
Core 2 E6750
Motherboard
ASUS P5KPL
Memory
2gb
Graphics Card(s)
NVIDIA GeForce 210
Sound Card
Creative Audigy 2 ZS
Monitor(s) Displays
Philips 17''
Screen Resolution
1280x1024
Keyboard
Logitech K300
Mouse
Logitech M500 Corded Mouse

My Computer My Computer

At a glance

Windows 7 Ultimate 32bitCore 2 E67502gbNVIDIA GeForce 210
OS
Windows 7 Ultimate 32bit
CPU
Core 2 E6750
Motherboard
ASUS P5KPL
Memory
2gb
Graphics Card(s)
NVIDIA GeForce 210
Sound Card
Creative Audigy 2 ZS
Monitor(s) Displays
Philips 17''
Screen Resolution
1280x1024
Keyboard
Logitech K300
Mouse
Logitech M500 Corded Mouse
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/index.php?topic=28490.msg266612#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 My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Back
Top