нагуглил такой код, не заработал.
Код:
sProcessName = "process.exe"
sComputer = "." ' use "." for local computer
Set oWmi = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & sComputer & "\root\cimv2")
Set oShell = CreateObject("WScript.Shell")
' go into eternal loop
Do
Set colProcessList = oWmi.ExecQuery _
("Select * from Win32_Process Where Name = '" & sProcessName & "'")
If colProcessList.Count = 0 Then
' process is not running
' do the CLFYtest here
If remote server is up Then
oShell.Run "C:\name.exe", 1, False
End If
End If
WScript.Sleep 5 * 60 * 1000 ' wait 5 minutes before trying again
Loop
где ошибка ?