Created
February 27, 2017 00:49
-
-
Save kinifi/6b9f69edcc0e9c12831935afd9698e29 to your computer and use it in GitHub Desktop.
general method to run commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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