How to start a process using C#?

Hello,

I would like to either execute a shell command or start a process on an android device.

Process checkForUpdates = new Process();
checkForUpdates.StartInfo.FileName = @Tools/bash.exe;
checkForUpdates.StartInfo.Arguments = "python -V";
checkForUpdates.StartInfo.UseShellExecute = false;
checkForUpdates.StartInfo.RedirectStandardOutput = true;
checkForUpdates.StartInfo.RedirectStandardError = true;
checkForUpdates.StartInfo.CreateNoWindow = false;
checkForUpdates.EnableRaisingEvents = true;
checkForUpdates.Start();

Running the above code through a background worker makes the code execution stop. Any ideas?

Thank in advance

Tagged:
Sign In or Register to comment.