VB Script for App

VB Скрипт за проверка на работещо приложение 

Dim objWMIService, colItems, objItem, strComputer, strFlashEXEFile
Dim count

strEXEFileName = "програмата.exe"
strEXEFilePath = "пътя до  ехе-то, което ще изпълняваме може и пряк път "
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.InstancesOf("Win32_Process")

count = 0

ForEach objItem In colItems
    If objItem.Name = strEXEFileName Then
        count = count + 1
    Else
    EndIf
Next

Set objWMIService = Nothing
Set colItems = Nothing

If count = 0Then

    Dim oShell
    Set oShell = WScript.CreateObject ("WScript.Shell")
    Return = oShell.run(strEXEFilePath,1, false)
    Set oShell = Nothing

EndIf