In VBScript is it possible to query a specific service name if it's started or running? if its running then execute finally my application. So here is how the flow i am trying to prepare:
- System is booted
- Windows 8.1 Startup script is executed (VBS)
VBScript now wait and keep checking if the service name "NGINX" started or running already.
- If RUNNING, then execute
notepad.exe
. - If not RUNNING, then start the service "NGINX" and make sure its now "RUNNING". if now "RUNNING" then finally execute
notepad.exe
.
- If RUNNING, then execute
Is this possible with VBScript?
Example: this line 6 should be only executed if the service NGINX is running otherwise it should never execute that.
Option Explicit
Dim ws
set ws = CreateObject("wscript.shell")
Dim a
a = "C:\Program Files (x86)\abcd\kiosk.jar"
ws.run "java.exe -cp " & chr(34) & a & chr(34) & " kiosk", 0, False