Yes, get rid of the ".exe". and only use "Test". Not sure if
capitalization makes a difference, but I know that the file suffix is not
returned by the GetProcessesByName function.
"kd" <kd@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
Hi All,
Process.GetProcessesByName() is not giving the expected results. Here is a
sample code.
Dim TestProcess() As Process
Try
TestProcess= Process.GetProcessesByName("Test.exe")
If TestProcess.Length = 0 Then
MsgBox("Not running", MsgBoxStyle.OKOnly)
Else
MsgBox("Running", MsgBoxStyle.OKOnly)
End If
Catch ex As Exception
MsgBox("Error!")
End Try
"Not Running" is displayed, though Test.exe is running.
Would anybody be able to figure out why?
Thanks.
kd