【发布时间】:2015-07-16 13:10:27
【问题描述】:
我需要运行命令:
certmgr.exe -add MyCert.cer -s -r localMachine trustedpublisher
现在我遇到的问题是 certmgr.exe 不在我的路径中。我也不想将它添加到我的路径中。
好的,我当然可以这样做:
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 11.0
certmgr.exe 的路径是上面的 Microsoft Visual Studio 11.0 路径。
但我应该能够使用可执行文件的完整路径运行命令。
所以我尝试了以下方法:
>"C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe" -add comodo.cer -s -r localMachine trustedpublisher
'"C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe"' is not recognized as an internal or external command, operable program or batch file.
>"..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe" -add comodo.cer -s -r localMachine trustedpublisher
'"..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe"' is not recognized as an internal or external command, operable program or batch file.
>start "C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe" -add comodo.cer -s -r localMachine trustedpublisher
The system cannot find the file -add.
>set THISPROG=C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe
>%THISPROG% -add comodo.cer -s -r localMachine trustedpublisher
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
>"%THISPROG%" -add comodo.cer -s -r localMachine trustedpublisher
'"C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe"' is not recognized as an internal or external command, operable program or batch file.
如何运行命令:
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\certmgr.exe" -add comodo.cer -s -r localMachine trustedpublisher
没有将“C:\Program Files (x86)\Microsoft Visual Studio 11.0 添加到我的路径?
【问题讨论】:
-
你设法让它工作了吗?这绝对是在使用记事本示例!! :0)
-
where /R C:\ certmgr.exe的输出是什么?或者(相同)dir /B /S C:\certmgr.exe?