I want to end a process that I started with a ProcessStartInfo, here's the code to start it
public class MyProcess
{
void OpenWithStartInfo()
{
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = true;
startInfo.FileName = "C:/StartBot.bat";
Process.Start(startInfo);
}
public static void Start()
{
MyProcess myProcess = new MyProcess();
myProcess.OpenWithStartInfo();
}
public static void End()
{
}
}
I want to end the process that I started with my End() function, but I have no idea how to go about doing that. Any help will be greatly appreciated.