Search This Blog

Powered By Blogger

Saturday, May 22, 2010

detect if a program is running ....

Set WshShell = WScript.CreateObject ("WScript.Shell")
Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from Win32_Process")
'==============================================================================================
file_name = inputbox("What file to execute?", "File name?", "c:\boot.ini")+".exe"

For Each objProcess in colProcessList

If objProcess.name = file_name then
vFound = True
End if
Next
If vFound = True then
Msgbox("Found")

Else
Msgbox("Not Found")
End If

No comments:

Post a Comment