Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Lock Workstation

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,54731
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Lock Workstation
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Lock Workstation - 12/27/2007 1:56:51 PM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
'script by MJP 2007
'Lock Workstation



'Tested, works on XP Pro, Windows2003 Server
'Click Script, walk away, console locked.



LockCMD="rundll32.exe user32.dll,LockWorkStation"
Set objShell = CreateObject("WScript.Shell")
objShell.Run LockCMD,0,True



WScript.Quit
 
 
Post #: 1
 
 RE: Lock Workstation - 1/2/2008 2:12:07 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Thanks for sharing, but why would double clicking a script be easier than pressing Windows-L?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Meg)
 
 
Post #: 2
 
 RE: Lock Workstation - 1/2/2008 2:24:25 AM   
  DiGiTAL.SkReAM


Posts: 1101
Score: 6
Joined: 9/6/2005
From: Florida, USA
Status: offline
What if you didn't have the Windows key on your keyboard?  I know a lot of people - especially those who do data-entry for large companies - that prefer the old style keyboards that have the AT keyboard plug, that way 40 pounds, and that make a clicky sound when a key is pressed.

Frankly, thisis the first time I have ever heard of the Windows-L combo, as I tend to just ignore the key, myself.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Lock Workstation - 1/2/2008 2:32:36 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
That is a good point regarding the keyboard.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 4
 
 RE: Lock Workstation - 1/2/2008 11:15:20 AM   
  Meg


Posts: 123
Score: 2
Joined: 7/13/2006
From: Australia
Status: offline
Thanks, Did think about a windows hot key, 
Idealy I wanted to write a script that locked a remote workstation but only came up with this one. This one only works if copied there first. Anyway...
At least you could tie it into another script.

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Lock Workstation - 1/4/2008 3:23:02 AM   
  mcds99


Posts: 407
Score: 4
Joined: 2/28/2006
Status: offline
Ctrl+Alt+Del + ENTER

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to Meg)
 
 
Post #: 6
 
 RE: Lock Workstation - 1/4/2008 7:56:21 AM   
  Rischip


Posts: 393
Score: 2
Joined: 3/26/2007
Status: offline
Here's your remote version...... And Win-L doesn't work on Win2k

LockRemoteWS.vbs


      

LockWS.vbs


      

< Message edited by Rischip -- 7/16/2008 6:38:13 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to mcds99)
 
 
Revisions: 2 | Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Lock Workstation Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts