Jump to content

Admin quick lock and log


Nova
 Share

Recommended Posts

Hi i cant seem to send the keys

Windows key down and L which is the command for and administrator to lock a computer down and exit to the logon screen.

Can anyone help me wiht this ?

If the windows key isnt allowed to be sent ! Dose anyone know of a way I can achieve this with out using the hotkey Win L ?

:ph34r:

Link to comment
Share on other sites

@nova

According to the online documentation:

{LWIN}          Left Windows key

{RWIN}          Right Windows key

{LWINDOWN}  Holds the left Windows key down until {LWINUP} is sent

{RWINDOWN}  Holds the right Windows key down until {RWINUP} is sent

But after testing a few key combinations, they do not work. Try a 3rd party utility, such as, LockXP, to do the system locking. I got that from here.

*** Matt @ MPCS

Link to comment
Share on other sites

@JdeB

For some reason {LWINUP} does not work, I tested that exact line of code and thought it worked but for some reason the Win key stays depressed.

*** Matt @ MPCS

Edit: Are you running XP Home or Pro? according to some documentation I read on the net, WinKey + L isn't supposed to work in Home.

Edited by Matt @ MPCS
Link to comment
Share on other sites

  • Developers

@nova

According to the online documentation:

But after testing a few key combinations, they do not work. Try a 3rd party utility, such as, LockXP, to do the system locking. I got that from here.

*** Matt @ MPCS

<{POST_SNAPBACK}>

doesn't this work for you ??? It does work on my XP:

Send("{LWINDOWN}l{LWINUP}")

Edit: ah... let me try again.... didn't notice that it remained pressed....

Edit2: yeap you are right....

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Run("rundll32.exe user32.dll,LockWorkStation")

<{POST_SNAPBACK}>

knew i saw it before in the forum ... just couldn't find it....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 1 year later...

Huh, you're right. The first time I tried my above code, it seemed to work fine, and I carried on doing what I was doing before without noticing whether the key was stuck. The strange thing is, you'd think I would have hit a key while typing that would trigger a Windows key combination. Perhaps it gets unstuck when pressing some other keys, or it unsticks itself over time.

Of course, now that I'm deliberately testing to see whether it gets stuck down, I can see that it does. Weird.

Link to comment
Share on other sites

i had tried to this a while back too. I just assumed that the releasing of the windows key was stopped because the user was logged off and that that stopped or messed up the script for a short while. That was just what I had assumed though. You could write something that releases the windows key once anyone logs back onto that computer. I think that could work but i'm not sure if the windows key can do anything while you are on the login screen. hmmm...

Link to comment
Share on other sites

Yeah, I too thought that may have something to do with it so I tried sending a LWINUP and a RWINUP after the user unlocks the computer but it didnt work - the Winkey was still depressed. Only manually depressing the Winkey unstuck it and since not every keyboard has a Winkey, this became a problem in that I couldn't just ask the user to "Press the Winkey" in a message box after they had unlocked the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...