I need to remove saved credentials of network shares from the windows cache programmatically.I searched for it but couldn't find a solution. But I solved this issue by executing the following statement in command prompt.
net use \\someloaction /del
Now i need to execute the cmd statement using asp.net c#.
I tried the following code. But its not working.
var startInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
var process = new Process { StartInfo = startInfo };
process.Start();
process.StandardInput.WriteLine("net use \somelocation /del");
process.StandardInput.WriteLine("exit");
process.WaitForExit();