Batch file - additional input lines to called program

  • Thread starter Thread starter Bob F
  • Start date Start date
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
 
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
 
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.
 
Back
Top