Signtool 总是说缺少参数

Signtool always says a parameter is missing

我最近在 Unity3D 中制作了一款游戏,我正在尝试使用从 Comodo 购买的证书(保存在 pfx 文件中)对代码进行签名。我对如何使用它进行了大量研究,并决定使用 运行 这些命令:

doskey signtool="C:\Program Files (x86)\Windows Kits\Tools\bin\i386\signtool.exe"
signtool sign /f "C:\...[path to cert on desktop]...\cert.pfx" "C:\...[path to exe on desktop]...\Game.exe"

无论我做什么,或者我尝试了细微的变化,或者任何其他事情,我总是得到同样的错误:

SignTool Error: A required paramter is missing.
Usage: signtool <command> [options]

甚至 运行 "signtool sign /?" 也给我同样的错误。我不明白为什么这个程序不能做,甚至不能告诉我任何有用的东西。我看到的一些消息来源说我需要在 /f 选项后添加一个“/p passwordHere”,但这会给出与所有其他消息相同的错误消息。

您必须让 doskey 知道宏 signtool 需要参数,这些参数将传递给真正的 signtool.exe。这是通过在定义的末尾附加 $* 来完成的。

doskey signtool="C:\Program Files (x86)\Windows Kits\Tools\bin\i386\signtool.exe" $*

来自官方 Doskey 文档(突出显示 我的):

To run a macro, type the macro name at the command prompt, starting at the first position. If the macro was defined with $* or any of the batch parameters through , use a space to separate the parameters.