如何在WinDbg的启动命令行中转义引号以打开转储

时间:2014-01-08 08:32:42

标签: command-line-arguments windbg

this answer之后,我试图在注册表中使用.dmp开关设置-c "..." shell命令,以便在我打开转储文件时执行命令。

虽然这适用于任何不使用引号的命令,但我现在想要使用需要引号的命令。如何避开引号,使它们不被视为-c "..."开关的结束?

我试过了:

  • 使用反斜杠\"
  • 转义
  • 通过将引号加倍""
  • 来逃避

详情如下:

注册表项:HKEY_CLASSES_ROOT\Windbg.DumpFile.1\shell\WinDbgStartup\command

(默认)值(工作):"C:\path to\windbg.exe" -z "%1" -Q -c ".echo Welcome"

(默认)值(已损坏):"C:\path to\windbg.exe" -z "%1" -Q -c ".echo Wel""come"

-z用于打开转储文件,-Q用于安静的工作空间,在-c我可以输入命令,我想要包含quatation标记。

错误讯息:The command line arguments cannot specify more than one kind of debugging to start

WinDbg版本:6.2.9200.16384 X86

1 个答案:

答案 0 :(得分:1)

你试过^"吗? ^转义cmd

中的大多数字符

(调查时)

来自WinDbg Command-Line Options

-c " command "

    Specifies the initial debugger command to run at start-up. This command must be 
    enclosed in quotation marks. Multiple commands can be separated with semicolons. 
    (If you have a long command list, it may be easier to put them in a script and 
    then use the -c option with the $<, $><, $><, $$>< (Run Script File) command.)

    If you are starting a debugging client, this command must be intended for the 
    debugging server. Client-specific commands, such as .lsrcpath, are not allowed.

点击$...超链接可进一步说明这些选项。

似乎你真的想在你的echo中加入。坦率地说,我不知道 - 但我会尝试的是-c ".echo Wel^"come"

如果这不起作用,我会前往$-option gobbledegook。没有人(理智)声称在构建这些设施时已经考虑过所有可能性......