Running command in command prompt from c# code error

0

I'm trying to execute the following command in command prompt from my c# application and I keep getting the following output and it's not running the command I specified, any help or direction in resolving this issue would be greatly appreciated!

Env:

Windows 10
.Net Standard

Error:

Error loading resource: 0x00003afc
Error loading resource: 0x00003b01

Code:

     public void CacheKerbose()
       {
           try
           {
               var proc = new Process();
               var procInfo = new ProcessStartInfo(@"cmd.exe", "/c" + "klist -li 0:0x3e7 purge");
               procInfo.RedirectStandardOutput = true;
               procInfo.UseShellExecute = false;
               procInfo.CreateNoWindow = true;
               procInfo.LoadUserProfile = true;
               proc.StartInfo = procInfo;
               proc.Start();
               proc.WaitForExit();
           }
           catch (Exception x)
           {
               Console.WriteLine(x.Message);
           }
       }
c#
windows
command-prompt
asked on Stack Overflow Jul 24, 2020 by SnowMan3333

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0