VB Script to close Windows session when IE Closed RRS feed

  • Question

  • Hi,

    I want to make an Internet Browser kiosk mode with Windows 7 and IE 11.

    I make a gpo to secure IE, and i search to close user session when user close Internet Explorer.

    Here is the script :

    set objIE    = Wscript.CreateObject("InternetExplorer.Application","IE_")
    Set WShShell = WScript.CreateObject("WScript.Shell")

    With objIE
        .Visible     = True
        .Silent      = False
        .FullScreen  = False
        .Navigate http://server.local
        Do While .Busy
            WScript.Sleep 100
    End With

    Sub IE_onQuit()
    Set WShShell = WScript.CreateObject("WScript.Shell")
    Set oExec = WshShell.Exec("C:\Windows\System32\logoff.exe")
    End Sub

    When i test the script, Internet explorer is launched but Windows session is closed immediatly.

    What can i do.



    Laurent BOUDON

    • Edited by thepuriner Wednesday, April 5, 2017 2:18 PM
    Wednesday, April 5, 2017 2:17 PM

All replies