Skip to content

Instantly share code, notes, and snippets.

@kinifi
Created February 27, 2017 00:49
Show Gist options
  • Save kinifi/6b9f69edcc0e9c12831935afd9698e29 to your computer and use it in GitHub Desktop.
Save kinifi/6b9f69edcc0e9c12831935afd9698e29 to your computer and use it in GitHub Desktop.
general method to run commands
private void RunScript(string scriptPath, string arguments)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = Path.GetFullPath(scriptPath);
startInfo.UseShellExecute = true;
startInfo.CreateNoWindow = false;
if (!string.IsNullOrEmpty(arguments))
startInfo.Arguments = arguments;
Process proc = Process.Start(startInfo);
proc.WaitForExit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment