how do i check if a process is running, im making a program that starts "notepad" etc, if it aint allready open...
something like, if process("notepad") running then
----
else
run notepad
kinda thing ;)
Printable View
how do i check if a process is running, im making a program that starts "notepad" etc, if it aint allready open...
something like, if process("notepad") running then
----
else
run notepad
kinda thing ;)
The correct namespace is: System.Diagnostics.Process
VB Code:
private void IsNotePadRunning() { System.Diagnostics.Process[] pro = System.Diagnostics.Process.GetProcessesByName("notepad"); if (pro.GetLength(0) > 0) { //do your work here } else { System.Diagnostics.Process.Start("notepad.exe"); } }
It works perfect thx dude