JustScriptIt
Technical User
I'm creating a script that involves stopping and starting a service.
How do I handle a situation where service fails to start on time, say, after 2 minutes?
Code to start service
How do I handle a situation where service fails to start on time, say, after 2 minutes?
Code to start service
Code:
do
Set colProcesses = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"). _
ExecQuery("Select * from Win32_Process Where Name='smc.exe'")
wscript.sleep 100
loop until (colProcesses.count > 0)