AutoHotkey Community

It is currently May 27th, 2012, 9:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 3rd, 2011, 7:48 am 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
Okay... seem to be having a problem with what should be a very straight forward and simple script.
All I want to do is create a script that will lock a Windows 7 workstation and then have the monitor go in to a power saving state. Seems simple enough right, yeah... so I thought.
So here's the code:
Code:
sleep, 1000
Run RunDll32.exe user32.dll,LockWorkStation
sleep, 1000
SendMessage,0x112,0xF170,2,,Program Manager ; send the monitor into standby (off) mode
ExitApp

Now the 4th line works just fine. Standby comes up with no problem. The RunDLL part is what's failling. The funny thing is, I can send
Quote:
RunDll32.exe user32.dll,LockWorkStation
to the RUN command and it works fine.

Okay... so as to squash any question: UAC has been turned off on the "test" system.

So... anyone with an idea?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2011, 9:27 am 
Offline

Joined: July 10th, 2008, 8:49 am
Posts: 1865
Location: Brussels, Belgium
Just one thing :
N00B ! :twisted:

Code:
sleep, 1000
Run RunDll32.exe user32.dll,LockWorkStation
sleep, 1000
SendMessage,0x112,0xF170,2,,Program Manager ; send the monitor into standby (off) mode
ExitApp


Don't you see something that messes up ???

You must escape the comma !!!

Code:
sleep, 1000
Run RunDll32.exe user32.dll`,LockWorkStation
sleep, 1000
SendMessage,0x112,0xF170,2,,Program Manager ; send the monitor into standby (off) mode
ExitApp


It's working fine just with the `, :-D

I was joking, you're no n00b, it's happening to the best of us, espacially to the best... ;-)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2011, 5:29 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
CodeKiller wrote:
Just one thing :
N00B ! :twisted:
Man!... rack me over the coals... hahahaha

CodeKiller wrote:
You must escape the comma !!!
I can't believe I missed that. Thanks for pointing it out


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, hyper_, tomoe_uehara, Yahoo [Bot] and 74 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group