So in this post, let me show you how to do that.
First, create a file that will contain all the commands that you would like to run.
For this example, let me create a file called 'dbg-prep.cmd'
C:\Users\ilhoye\Desktop\WinDbg> type dbg-prep.cmd
.symfix
.reload
.load mex
.load kdexts
aS !pr !process
Once we have this, we can just launch windbg with '-c' option. '-c' is a command to execute when windbg starts up but for our case, we want to execute several command and that is why I created a script in the first place.
To do that, we still use '-c' option but now this time we want to provide file path as follows.
windbg.exe -c "$$>< C:\Users\ilhoye\Desktop\WinDbg\dbg-prep.cmd
Please note that '-c' option needs to be quoted like the above.
Of course, it is cumbersome to type all these so it would be best to create a shortcut for this and in fact, as for me here is my shortcut command which also specifies the connection for kernel debugging.
"C:\Program Files\Debugging Tools for Windows (x64)\windbg.exe" -k 1394:channel=2 -c "$$>< C:\Users\ilhoye\Desktop\WinDbg\dbg-prep.cmd"
You can also add arguments to the script and for more information, please refer to msdn.
thanks man! ;)
ReplyDeleteIn my script I just have a few .sympath+ and .srcpath+ lines. But for each line, I got an error: "The filename, directory name, or volume label syntax is incorrect". Do you know what I have missed?
ReplyDeleteIn addition, I also like to add .reload and .ecxr if I can.
Thanks.
This comment has been removed by the author.
DeleteNeed add double quotation for the path.
Deletee.g.
.sympath+ "D:\myPath"