Here is the awesome VB.Net code to check whether the application/process is running or not by passing the process name:
Module modMain
Sub Main()
'Check whether acrobat is running or not
If IsProcessRunning("acrobat") Then
Console.WriteLine("Yes. Acrobat is running")
Else
Console.WriteLine("No. Acrobat is not running")
End If
End Sub
Private Function IsProcessRunning(ByVal sProcess As String) As Boolean
For Each oProc As Process In Process.GetProcessesByName(sProcess)
Return True
Next
End Function
End ModuleProject Type: Console
Language: VB.Net
Tested with: VS 2008
