Skip to content

Commit

Permalink
Test sur runCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdeguet committed Oct 17, 2024
1 parent 6dda5ac commit 6087bb7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scriptsharp/ScriptSharp/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ public static void RunCommand(string command)
{
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
FileName = "C:\\Windows\\System32\\cmd.exe",
Arguments = $"/c {command}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
UseShellExecute = true,
CreateNoWindow = true,
WorkingDirectory = Environment.CurrentDirectory
};
processStartInfo.EnvironmentVariables["PATH"] = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.User);

using Process process = Process.Start(processStartInfo);

Expand Down Expand Up @@ -141,7 +143,8 @@ public static async Task CompressFolderTo7ZAsync(string folderPath, string outpu
Arguments = $"a \"{output7ZFilePath}\" \"{folderPath}\\*\"",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
CreateNoWindow = true,
WorkingDirectory = Environment.CurrentDirectory
};

using Process process = new Process();
Expand Down

0 comments on commit 6087bb7

Please sign in to comment.