I'm currently trying to run some commands within my C# program but get an "access denied" error when I try to cd. I read that changing UseShellExecute to be true would give me admin access but whenever I do that I get the following error:
Exception thrown: 'System.PlatformNotSupportedException' in System.Diagnostics.Process.dll
I've tried setting cmd.UserName to null and cmd.Verb to "runas" but still get that same error. I'm also running visual studio as an admin. The issue is not with how to get admin access but why do I get an exception when I try to run it as an admin
ProcessStartInfo cmd = new ProcessStartInfo("cmd.exe");
cmd.RedirectStandardInput = true;
cmd.UseShellExecute = false;
cmd.CreateNoWindow = false;
cmd.WindowStyle = ProcessWindowStyle.Normal;
Process console = Process.Start(cmd);
console.StandardInput.WriteLine(" cd ..");