Powershell nConvert Can';不创建文件

Powershell nConvert Can';不创建文件,powershell,file-conversion,Powershell,File Conversion,因此,我在Powershell中收到以下错误 .\nconvert.exe : Error: Can't create file (\\vm912test\c$\JCL Testing\Converted Output\2013\06\MMM7777.pdf) At M:\Powershell\test4.ps1:61 char:8 + .\nconvert.exe -quiet -out pdf -c 3 -multi -n 1 $PageCount 1 -o "$Outpu

因此,我在Powershell中收到以下错误

.\nconvert.exe :   Error: Can't create file (\\vm912test\c$\JCL Testing\Converted Output\2013\06\MMM7777.pdf)
At M:\Powershell\test4.ps1:61 char:8
+        .\nconvert.exe -quiet -out pdf -c 3 -multi -n 1 $PageCount 1 -o "$OutputL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (  Error: Can't ...06\MMM7777.pdf):String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
如果有人有任何与nConvert合作的经验,这将非常有帮助。
我使用的代码行是:

.\nconvert.exe -quiet -out pdf -c 3 -multi -n 1 $PageCount 1 -o "$OutputLocation\$Year\$Month\$BusinessUnit$CheckNumber.pdf" "$TIFPath\$pattern####.tif"

您需要在输出文件名中添加引号,因为它包含空格。我通常这样做是为了强制外部命令的格式完全符合我的要求:

$myCommand=“nconvert-q 100-out tif-overwrite-o”+(“+$OutputFilePath+”)+”+(“+$InputFilePath+”)

写入主机$myCommand

调用表达式$myCommand


使用write host检查格式化,并使用invoke expression逐字运行命令。

从dos提示符运行时,您使用的命令行是否工作?是,命令行在dos提示符下工作。