Hey, I'm trying to use a "net use" command that I use to disconnect from all network paths, but when I use it in C# it doesn't do anything. And when I try to run "net use" separately and not pass all the other arguments I noticed that it returns text as if I had no network paths, but when I run the exact same command in CMD it return a list of my network paths.
Here's part of the code:
This code includes the part where I send the output to a textbox I've named "Log".
Resetproc is a process element I put into my windows form.
The commented line is the command that I want to use, but I commented it out so I could try net use.
Here's a pic of the output (white is C#, black is CMD): https://i.gyazo.com/2d3882a3996e8f9576529a1b21cac041.png
Thank you,
Exouxas
Here's part of the code:
Resetproc.StartInfo.UseShellExecute = false;Resetproc.StartInfo.RedirectStandardOutput = true; Resetproc.StartInfo.FileName = "net.exe"; Resetproc.StartInfo.Arguments = "use"; //Resetproc.StartInfo.Arguments = "use * /delete /yes"; Resetproc.Start(); String resetOutput = Resetproc.StandardOutput.ReadToEnd(); Resetproc.WaitForExit(); Log.AppendText(resetOutput + "\r\n----------\r\n");
This code includes the part where I send the output to a textbox I've named "Log".
Resetproc is a process element I put into my windows form.
The commented line is the command that I want to use, but I commented it out so I could try net use.
Here's a pic of the output (white is C#, black is CMD): https://i.gyazo.com/2d3882a3996e8f9576529a1b21cac041.png
Thank you,
Exouxas
Last edited: