I have created a VBScript that runs interactively/visible as a Windows
startup script via Domain Group Policies. My script calls
CreateObject("InternetExplorer.Application") to display a form and
everything works correctly, but Windows is waiting for the script to
finish before displaying the login window. I can run another script and
quit the first script to get around this, but anything started by the
following means is not interactive/visible, even if it is forced to be
visible by all means that I have tried. I can keep the first instance
of Internet Explorer open, but is there any way to connect to that
instance of Internet Explorer from the second script, or is there
another way to start the second script similar to CreateObject?
These do not work:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "WSCRIPT.EXE """ & WScript.ScriptFullName & """" & "
/Start"
'Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = 5
objConfig.PriorityClass = NORMAL
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
ScriptPath = Left(WScript.ScriptFullName, InStr(WScript.ScriptFullName,
WScript.ScriptName) -1)
errReturn = objProcess.Create("CSCRIPT.EXE """ & WScript.ScriptFullName
& """" & " /Start", null, objConfig, intProcessID)
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("WSCRIPT.EXE """ & WScript.ScriptFullName &
"""" & " /Start")
--
a178235
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------