+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Lock computer with wsf vbscript? in Coding and Web Development; Hi, We use Microsoft Deployment Toolkit to install our machines. One problem we have is that the ztiwindowsupdate.wsf file doesnt ...
  1. #1

    Join Date
    Nov 2011
    Posts
    603
    Thank Post
    84
    Thanked 21 Times in 19 Posts
    Rep Power
    9

    Lock computer with wsf vbscript?

    Hi,

    We use Microsoft Deployment Toolkit to install our machines.

    One problem we have is that the ztiwindowsupdate.wsf file doesnt lock the screen when its installing updates leaving it open and logged on as administrator.

    Does anyone know of a piece of code that i can include to lock the computer?

    Many thanks.

  2. #2

    Join Date
    Nov 2011
    Posts
    603
    Thank Post
    84
    Thanked 21 Times in 19 Posts
    Rep Power
    9
    Found the answer.

    DIM objShell
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"

    Has to be put with all the other dim in the the main content part.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 4
    Last Post: 18th July 2012, 02:26 PM
  2. Replies: 14
    Last Post: 10th June 2009, 04:08 PM
  3. Unable to unlock a locked computer
    By _Bat_ in forum Windows
    Replies: 23
    Last Post: 13th June 2008, 10:53 PM
  4. Replies: 24
    Last Post: 14th February 2008, 11:47 AM
  5. auto lock computer after set time
    By timbo343 in forum Windows
    Replies: 13
    Last Post: 30th March 2007, 07:54 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •