vbs script to replace explorer as the defult shell

hi folks,

im trying to write a vb script to set the shell to internet explorer on windows 2000 machines. the script is supposed to replace explorer with internet explorer and should IE get closed it should either log off the user or restart IE.

heres what i have so far…

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errResult = objWMIService.Create("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "C:\Program Files\Internet Explorer\IEXPLORE.EXE", null, intPosID)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecNotificationQuery _
    ("Select * From __InstanceDeletionEvent " _ 
            & "Within 1 Where TargetInstance ISA 'Win32_Process'")

Do Until False = True
    Set objProcess = colProcesses.NextEvent
    If objProcess.TargetInstance.ProcessID = intPosID Then
        Exit Do
    End If

can some kind person tell me what im doing wrong please?


whats it doing or not doing? I’ll throw this on a VM in a bit for you, see what it’s doing

i doesnt seem to be doing anything as far as i can tell.

it should be launching IE as the “shell” rather than explorer and if IE gets terminated should log the user off…

Set objIExplorer = CreateObject(“internetexplorer.application”)
objIExplorer.visible = True
objIExplorer.navigate http://www.XYZ.com

Don’t you need to create the object first?