Last active
May 24, 2019 10:44
-
-
Save mehmetcanyegen/429d94d231869cc1a84f3e33a6cbd5a7 to your computer and use it in GitHub Desktop.
c# mapping delete net use
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
try | |
{ | |
System.Diagnostics.Process process = new System.Diagnostics.Process(); | |
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); | |
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; | |
startInfo.FileName = "cmd.exe"; | |
startInfo.Arguments = string.format("/c net use * /delete /y"); | |
process.StartInfo = startInfo; | |
process.Start(); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment