Showing posts with label Start Service. Show all posts
Showing posts with label Start Service. Show all posts

Friday, February 3, 2017

VBScript - How to make program wait until process has finished

const DontWaitUntilFinished = false, ShowWindow = 1, DontShowWindow = 0, WaitUntilFinished = true
set WScript_Shell = WScript.CreateObject("WScript.Shell")
command1 = "C:\xampp\apache_stop.bat"
command2 = "C:\xampp\apache_start.bat"
Wscript.Echo "Apache Server Stopping"
WScript_Shell.Run command1, DontShowWindow, WaitUntilFinished
Wscript.Echo "Apache Server Stopped"
Wscript.Echo "Apache Server Starting"
WScript_Shell.Run command2, DontShowWindow, DontWaitUntilFinished
Wscript.Echo "Apache Server Started"