I'm trying to run this command in cmd from c# but for some reason it doesn't work. But when I change my Argument to "/C ipconfig" it work perfectly. I don't understand why. What am I doing wrong? Here is my code:
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = $"/C wbadmin start backup - backupTarget:{TargetBackupDrive}: -include:{LocationOs}: -allcritical - quiet";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.Verb = "runas";
process.Start();
CmdOutput = process.StandardOutput.ReadToEnd();
process.WaitForExit();