Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("myprogram.exe")
For Each p As Process In pProcess
p.Kill()
Next
At one point it's running twice and the above code kills em all including the one currently running, resulting in an access error. Is there any way to say, kill the older myprogram.exe only. Compare both of them and see which one was executed first and terminate this one, keeping the later one running. Any help would be appreciated.

New Topic/Question
Reply



MultiQuote




|