0

我在 wwitch .pcl 中有一个文件夹,并且写入了 .ps 文件。

我希望打印这些文件,如果找到的话,唯一的可能是 cmd LPR命令

脚本是:

set shApp = CreateObject("shell.application")
Set oShell = WScript.CreateObject ("WScript.Shell")
currentPath = "c:\printAll\" 
set shFolder = shApp.NameSpace( currentPath )
set files = shFolder.Items()
for each files in files

    if files.name <> "printAll" then
        'msgbox("printing "&files.name) 
                                oShell.run "cmd.exe /C LPR -S SRV00APP.N-IX.LOCAL -P HP400MFP    #{shFolder}/#{files.name} "


    end if
next

如何将属性作为currentPathfiles.name 传递给 cmd 行命令?

4

1 回答 1

1

尝试像这样构建字符串:

 oShell.run "cmd.exe /C LPR -S SRV00APP.N-IX.LOCAL -P HP400MFP    #{" & shFolder & "}/#{" & files.name "} "

(不确定你是否需要所有的括号等)

于 2015-10-05T13:01:18.843 回答