cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
onlyphanim
Level 3

Function to check whether an application is running or not while uninstalling.

Hi All,

How do we can check whether an ".exe" is executing or not while uninstallation.

For example: When my uninstaller code is launched it should check for "abc.exe" is executing or not if it is executing i need to set message box the abc.exe is working now please close abc.exe and try uninstall again.

I need function in IS2011 to check abc.exe is presently running or not.

Please help me, Thanks in advance.

Phani
Labels (1)
0 Kudos
(1) Reply
manomatt
Level 8

You can use a vbscript to check

/////////////////////////////////////////
Sample Code which checks if notepad.exe is running
/////////////////////////////////////////

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList
MsgBox "Notepad is runnning..."
Next
0 Kudos