Skip to content

Instantly share code, notes, and snippets.

@navchandar
Created March 6, 2019 13:28
Show Gist options
  • Select an option

  • Save navchandar/6dbdaf5024df44d875cda1b8f6e74fdd to your computer and use it in GitHub Desktop.

Select an option

Save navchandar/6dbdaf5024df44d875cda1b8f6e74fdd to your computer and use it in GitHub Desktop.

Revisions

  1. navchandar created this gist Mar 6, 2019.
    20 changes: 20 additions & 0 deletions WinUnlock.vbs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    Set objShell = CreateObject("WScript.Shell")
    X = objShell.Popup("Delay Windows Locking?", 10, "WinUnlock", vbYesNo)

    Select Case X
    Case vbYes
    Do
    objShell.SendKeys ("{F15}")
    'MsgBox("Pressed F15 Key")
    WScript.Sleep 5000
    Loop

    Case vbNo
    'MsgBox("Exiting...")
    With CreateObject("WScript.Shell")
    ' Pass 0 as the second parameter to hide the window...
    .Run "taskkill /f /im Cscript.exe", 0, True
    .Run "taskkill /f /im wscript.exe", 0, True
    End With

    End Select