Certutil在使用python os.system命令窗口时出现“参数太多”错误

2024-09-19 23:44:05 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试使用以下代码将简单文件解码为临时文本文件:

os.system("start cmd /k certutil -f -decode \\SDHQFILE03.enxco.com\\arcgis\\General\\Solar\\R_and_D\\CodeLibrary\\Python\\EPE2.1.7\\34287.bat \\SDHQFILE03.enxco.com\\arcgis\\General\\Solar\\R_and_D\\CodeLibrary\\Python\\SETI\test3.txt")

每次运行此命令时,我都会从certutil收到一个错误,即我的参数太多(3个,预期2个)-将代码直接复制到命令窗口中,如图所示,它会正确运行:

certutil -f -decode \\SDHQFILE03.enxco.com\\arcgis\\General\\Solar\\R_and_D\\CodeLibrary\\Python\\EPE2.1.7\\34287.bat \\SDHQFILE03.enxco.com\\arcgis\\General\\Solar\\R_and_D\\CodeLibrary\\Python\\SETI\test3.txt

我在第一条语句中遗漏了什么,以允许它无错误地运行


Tags: and代码txtcomgeneraldecodearcgisseti