0

I have a folder in witch .pcl and .ps files are written.

I want those files to be printed, the only possibillity to do this if found is cmd LPR command

the script is:

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

How can i pass attributes as currentPath or files.name to cmd line command?

Taras Vykh
  • 23
  • 2

1 Answers1

1

Try building the string like:

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

(not sure if you need all the brackets etc)

Fred
  • 5,663
  • 4
  • 45
  • 74
  • thanks! ended with: `oShell.run "cmd.exe /C LPR -S "& printerHost &" -P "& printerName &" " & currentPath & "\" & files.name & " "` – Taras Vykh Oct 05 '15 at 13:35