Stopping a running program.

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

I've got a program that will do some updates to the system. During that
time, if a certain program, called a.exe is running, I want to stop the
program, do what I need to do and restart the program.

How can I find out if a.exe is currently running and stop it?

TIA - UJ.
 
Like this

Dim Process As System.Diagnostics.Process
Process =
System.Diagnostics.Process.GetProcessesByName("ProcessName")(0)
Process.Kill()
 
To restart the process

_Process = New System.Diagnostics.Process
_Process.Start("PathToExe.exe")
 
Back
Top