I am trying to determine if an exe is already running on a machine.
Right now, i do the following:
If ProcessesRunning("PredictiveLapAnalysis.exe") > 1 Then
So as you can see, I call the ProcessesRunning sub to determine if a particular exe is running.
Public Function ProcessesRunning(ByVal ProcessName As String) As Integer
Return Process.GetProcessesByName(ProcessName).GetUpperBound(0) + 1
However unfortunately, it always returns 0
What am I doing wrong? Is there a better way to do this within VB.net (VS2008) and XP? Yes I am an administrator on the target machine.
Looking for VB.net sytax help please!
Thanks in advance!