Reputation: 137
If I do the following manually it works fine but I must be able to do the same from C# and in addition be able to close the command window.
cdb.exe
is located which is
in my case C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86
cdb -z D:\Temp\CrashDump.dmp -logo c:\temp\mydump.text -c "q"
mydump.text
in c:\temp\
So I want to do the same from C#. I have tried several solutions. Here is the first one
Process.Start(@"program files (x86)\windows Kits\8.1\Debuggers\x86\cdb.exe", @"-z D:\Temp\CrashDump.dmp -logo c:\temp\mydump.text -c \\""q\\""");
This gives error when executed saying "The system cannot find the specified file.
My second attempt is
Process.Start("cmd.exe", @"program files (x86)\windows Kits\8.1\Debuggers\x86\cdb.exe -z D:\Temp\CrashDump.dmp -logo c:\temp\mydump.text -c \\""q\\""");
This open the command window but doesn't create the file mydump.text which it should.
I have also tried to add the command to a bat file but it will not work.
The command window should also be closed automatically after the file mydump.text
has been created.
Upvotes: 2
Views: 604
Reputation: 827
You can try this
using (var process = new System.Diagnostics.Process())
{
var startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = @"C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\cdb.exe";
startInfo.Arguments = @"-z D:\Temp\CrashDump.dmp -logo c:\temp\mydump.text -c ""q""";
process.StartInfo = startInfo;
process.Start();
}
Upvotes: 1