Jump to content



Photo

Lock Computer


  • Please log in to reply
10 replies to this topic

#1 nobby

nobby

    Prodigy

  • Active Members
  • PipPipPip
  • 188 posts

Posted 04 August 2004 - 03:09 AM

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







#2 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 04 August 2004 - 03:16 AM

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.
"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."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#3 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 04 August 2004 - 03:57 AM

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

info from http://www.jsiinc.com/SUBE/tip2000/rh2050.htm
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

#4 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 04 August 2004 - 03:43 PM

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)

#5 nobby

nobby

    Prodigy

  • Active Members
  • PipPipPip
  • 188 posts

Posted 05 August 2004 - 12:22 AM

Thanks for all the relpies...

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

Cheers
CheersNobby

#6 favorini

favorini

    Seeker

  • New Members
  • 6 posts

Posted 26 August 2004 - 11:37 PM

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

-FF

#7 favorini

favorini

    Seeker

  • New Members
  • 6 posts

Posted 27 August 2004 - 12:20 AM

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

-FF

<{POST_SNAPBACK}>

After more searching I found the following posts which provide an answer: use ControlSend.

http://www.autoitscript.com/forum/index.ph...wtopic=1384&hl=
http://www.autoitscript.com/forum/index.ph...wtopic=2762&hl=

-FF

#8 favorini

favorini

    Seeker

  • New Members
  • 6 posts

Posted 27 August 2004 - 12:42 AM

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

#9 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 27 August 2004 - 01:09 AM

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!

#10 favorini

favorini

    Seeker

  • New Members
  • 6 posts

Posted 27 August 2004 - 02:02 AM

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

#11 favorini

favorini

    Seeker

  • New Members
  • 6 posts

Posted 27 August 2004 - 02:20 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users