我有一个巫婆.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
如何将属性作为 currentPath 或 files.name 传递给cmd行命令?
答案 0 :(得分:1)
尝试构建字符串,如:
oShell.run "cmd.exe /C LPR -S SRV00APP.N-IX.LOCAL -P HP400MFP #{" & shFolder & "}/#{" & files.name "} "
(不确定是否需要所有括号等)