Batch file - additional input lines to called program

B

Bob F

It has been 15 years since I wrote batch files.
I am trying to make a batch file to do the following

To extract useful information out of the minidump file created:
1.. Open a command prompt (Start -> Run -> "cmd")
2.. cd \program files\debugging tools (Or wherever they are installed to)
3.. kd -z C:\debug\Mini???????-??.dmp
4.. kd> .logopen c:\debuglog.txt
5.. kd> .sympath srv*c:\symbols*http://msdl.microsoft.com/download/symbols
6.. kd> .reload;!analyze -v;r;kv;lmnt;.logclose;q
7.. You now have a debuglog.txt in c:\, open it in a text edit (Notepad?).
I created the following batch file.

cd "c:\program files\debugging tools for windows (x86)"

kd -z c:\debug\%1
..logopen C:\debug\debuglog.txt
..sympath srv*c:\symbols*http://msdl.microsoft.com/download/symbols
..reload;!analyze -v;r;kv;lmnt;.logclose;q
cd c:\debug

The line starting with "kd" executes. The command prompt 0: kd> is displayed,
and the additional lines are not executed by kd.exe.

Can anyone tell me how to make this work?

Many thanks
 
P

Pegasus [MVP]

Bob F said:
It has been 15 years since I wrote batch files.
I am trying to make a batch file to do the following

To extract useful information out of the minidump file created:
1.. Open a command prompt (Start -> Run -> "cmd")
2.. cd \program files\debugging tools (Or wherever they are installed to)
3.. kd -z C:\debug\Mini???????-??.dmp
4.. kd> .logopen c:\debuglog.txt
5.. kd> .sympath
srv*c:\symbols*http://msdl.microsoft.com/download/symbols
6.. kd> .reload;!analyze -v;r;kv;lmnt;.logclose;q
7.. You now have a debuglog.txt in c:\, open it in a text edit
(Notepad?).
I created the following batch file.

cd "c:\program files\debugging tools for windows (x86)"

kd -z c:\debug\%1
.logopen C:\debug\debuglog.txt
.sympath srv*c:\symbols*http://msdl.microsoft.com/download/symbols
.reload;!analyze -v;r;kv;lmnt;.logclose;q
cd c:\debug

The line starting with "kd" executes. The command prompt 0: kd> is
displayed, and the additional lines are not executed by kd.exe.

Can anyone tell me how to make this work?

Many thanks

I don't know anything about kd.exe but if it accepts piped input then this
should work:

@echo off
cd /d "c:\program files\debugging tools for windows (x86)"

echo> kd.scr .logopen C:\debug\debuglog.txt
echo>> kd.scr .sympath
srv*c:\symbols*http://msdl.microsoft.com/download/symbols
echo>> kd.scr .reload;!analyze -v;r;kv;lmnt;.logclose;q

kd -z c:\debug\%1 < kd.scr
cd /d c:\debug
 
B

Bob F

Pegasus said:
I don't know anything about kd.exe but if it accepts piped input then
this should work:

@echo off
cd /d "c:\program files\debugging tools for windows (x86)"

echo> kd.scr .logopen C:\debug\debuglog.txt
echo>> kd.scr .sympath
srv*c:\symbols*http://msdl.microsoft.com/download/symbols
echo>> kd.scr .reload;!analyze -v;r;kv;lmnt;.logclose;q

kd -z c:\debug\%1 < kd.scr
cd /d c:\debug

Just what I needed. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Crash dump 6
Probably caused by : i8042prt.sys 1
Need help with Windbg log 2
How to use verifier? 4
SNP2SXP.SYS 5
Help With Crash Dump Analysis 1
Windows Explorer Crash 1
Need minidump analyzed 4

Top