The Process
class allows you to spawn and stop local system processes. However, it is recommended that you always specify the full path to the executable file. Failing to do so causes the program to search for the executable in its working directory and may pose a security risk by executing a similarly named executable should the attacker find a leverage.
using var process = new Process();
myProcess.StartInfo.FileName = "foo";
using var process = new Process();
myProcess.StartInfo.FileName = "/bin/foo";