Nova Posted September 9, 2004 Share Posted September 9, 2004 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 ? Link to comment Share on other sites More sharing options...
Developers Jos Posted September 9, 2004 Developers Share Posted September 9, 2004 (edited) try: Send("{LWINDOWN}l{LWINUP}") Edited September 9, 2004 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 More sharing options...
Matt @ MPCS Posted September 9, 2004 Share Posted September 9, 2004 @novaAccording 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 sentBut 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 More sharing options...
Matt @ MPCS Posted September 9, 2004 Share Posted September 9, 2004 (edited) @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 September 9, 2004 by Matt @ MPCS Link to comment Share on other sites More sharing options...
Developers Jos Posted September 9, 2004 Developers Share Posted September 9, 2004 (edited) @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 September 9, 2004 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 More sharing options...
CyberSlug Posted September 9, 2004 Share Posted September 9, 2004 Run("rundll32.exe user32.dll,LockWorkStation") Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 9, 2004 Share Posted September 9, 2004 @CyberSlug Now that one works *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Developers Jos Posted September 9, 2004 Developers Share Posted September 9, 2004 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 More sharing options...
Nova Posted September 9, 2004 Author Share Posted September 9, 2004 Just what I was looking for tnx cyber Link to comment Share on other sites More sharing options...
PartyPooper Posted September 2, 2006 Share Posted September 2, 2006 Do we know why the Winkey remains depressed or is there a workaround outside of using the DLL call? I tried sending a {LWINUP} and a {RWINUP} but neither 'unstuck' the Winkey. I had to manually depress the Winkey to get it to reset. BTW, using WinXP Pro and the latest AI. Link to comment Share on other sites More sharing options...
Sokko Posted September 2, 2006 Share Posted September 2, 2006 (edited) Seems too obvious, but did you try: Send("#l") That works fine for me on XP SP2. (the second character is a lowercase L, not a 1) Edited September 2, 2006 by Sokko Link to comment Share on other sites More sharing options...
PartyPooper Posted September 2, 2006 Share Posted September 2, 2006 Yes, that was my first attempt. Second one was Send("{LWINDOWN}l{LWINUP}"). Both times the WinKey got stuck on and I had to manually depress the WinKey to 'unstick' it. I'm using XP Pro SP2 as well. Link to comment Share on other sites More sharing options...
Sokko Posted September 2, 2006 Share Posted September 2, 2006 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 More sharing options...
PartyPooper Posted September 4, 2006 Share Posted September 4, 2006 Cool, as I'm not the only one still having problems with the WinKey, it's either a Windows bug or an AutoIt one. Link to comment Share on other sites More sharing options...
Kyler Carlson Posted September 4, 2006 Share Posted September 4, 2006 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 More sharing options...
PartyPooper Posted September 4, 2006 Share Posted September 4, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now