22 lines
885 B
Plaintext
22 lines
885 B
Plaintext
' Starts the web simulator without windows (Windows autostart: shortcut in the Startup folder).
|
|
' gateway - web_sim_service.bat (authenticated local page and private engines per account)
|
|
' A gateway already running is not started twice.
|
|
Set sh = CreateObject("WScript.Shell")
|
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
|
dir = fso.GetParentFolderName(WScript.ScriptFullName)
|
|
sh.CurrentDirectory = dir
|
|
|
|
Function Running(pattern)
|
|
Running = False
|
|
Set procs = GetObject("winmgmts:").ExecQuery("SELECT CommandLine FROM Win32_Process")
|
|
For Each p In procs
|
|
If Not IsNull(p.CommandLine) Then
|
|
If InStr(1, p.CommandLine, pattern, vbTextCompare) > 0 Then Running = True
|
|
End If
|
|
Next
|
|
End Function
|
|
|
|
If Not Running("web_sim_service.bat") And Not Running("web_sim.py") Then
|
|
sh.Run "cmd /c """ & dir & "\web_sim_service.bat""", 0, False
|
|
End If
|