Sign in to follow this  
Followers 0
nobby

Lock Computer

11 posts in this topic

Could it be possible to add the "lock computer" to the shutdown function?

This would be very practical when running installs etc. At present I use psshutdown.exe -l, but it would be so much more elegant to do the lot in AutoIt.

Cheers

Nobby :ph34r:


CheersNobby

Share this post


Link to post
Share on other sites



I know the windows key+ l will bring you to the user log in screen (which is the XP version of locking the screen.) It's been a while since I've used 2000, but this might work on that version as well.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

I know the windows key+ l will bring you to the user log in screen (which is the XP version of locking the screen.)  It's been a while since I've used 2000, but this might work on that version as well.

<{POST_SNAPBACK}>

That doesn't work on 2k... Though does lock XP machines...

Run("rundll32.exe user32.dll,LockWorkStation") ;another method

info from  http://www.jsiinc.com/SUBE/tip2000/rh2050.htm

<{POST_SNAPBACK}>

that should work for all... and cool, been meaning to look that one up.

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

Thanks for all the relpies...

Cyberslug's solution works fine on 98, ME, 2K and XP...

Cheers


CheersNobby

Share this post


Link to post
Share on other sites

Is there a way to send keys to a window/dialog box while the screen is locked?

-FF

Share this post


Link to post
Share on other sites

Strange behavior with ControlSend. If I send a ":" with the screen locked it gets turned into a ";".

Send("#l")
Run("notepad.exe")
WinWait("Untitled - Notepad")
ControlSend("Untitled - Notepad","","Edit1",":;Hello from Notepad")

If I comment out the first line it works as expected and ":;hello from notepad" is seen in notepad window. Otherwise, ";;hello from notepad" is there.

I am running Win XP SP1 and AutoIt 3.0.102.

-FF

Share this post


Link to post
Share on other sites

Strange behavior with ControlSend.  If I send a ":" with the screen locked it gets turned into a ";".

Send("#l")
Run("notepad.exe")
WinWait("Untitled - Notepad")
ControlSend("Untitled - Notepad","","Edit1",":;Hello from Notepad")

If I comment out the first line it works as expected and ":;hello from notepad" is seen in notepad window.  Otherwise, ";;hello from notepad" is there.

I am running Win XP SP1 and AutoIt 3.0.102.

-FF

<{POST_SNAPBACK}>

http://www.autoitscript.com/fileman/users/pekster/pekster%27s%20scripting%20index.html

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/fileman/users/pekster/pekster%27s%20scripting%20index.html

<{POST_SNAPBACK}>

Thanks for the link. Unfortunately, this doesn't help me, because you are using Send to change the shift state, and this doesn't work when the screen is locked.

Also, I notice two things in your READ-ME.TXT:

It still says "USAGE: ShiftControlSend("title", "text", "classnameNN", "string", flag)".

All 5 args are required, although it sounds like flag is optional when you say 0 is the default behavior.

-FF

Share this post


Link to post
Share on other sites

Upon further inspection, I guess you aren't the author, so you can ignore my nitpicking. :">

A possible solution: if the control is an Edit control, the following seems to work.

ControlCommand ("Untitled - Notepad","","Edit1","EditPaste",':;Hello')

Is this issue with ControlSend not being able to send SHIFTed characters considered a bug, or is it a feature?

-FF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0