Hi,
you can kill the previous process that your application started, and start a new one. In order to be sure to kill the right process, you'll need to store the
BaseAddress
of started process, and then compare later to the one that you want to close.
List<int32> list = new List<int32>();
...
...
Process[] procs = Process.GetProcessesByName("explorer");
foreach (Process p in procs)
{
int baseAdd = p.MainModule.BaseAddress.ToInt32();
if(list.Contains(baseAdd))
p.Kill();
}
var r = Process.Start("explorer.exe", argument);
list.Add(r.MainModule.BaseAddress.ToInt32);
</int32></int32>
Regards