1

I have an amazing script i am going to use to for a bespoke print solution. There is one thing left to do. The script utilizes Start-Process –FilePath “c:\testfolder\*.docx” –Verb Print

how can i make it so it targets an installed printer on the client system without targeting/using the default printer? (another VBScript already uses the default).

PSVersion5. + W764bit

2 Answers 2

1
(New-Object -ComObject WScript.Network).SetDefaultPrinter('Xerox Floor X')

This does the trick, it will select the relevant default printer and then i can run another line which will default it back to the original default printer after the script runs.

Some issues with parentheses running and defaulting it back before it prints at the moment though.

Sign up to request clarification or add additional context in comments.

Comments

0

I dont think you can specify the printer when using the Print verb. What you can do is this:

Get-ChildItem -Path "C:\testfolder" -Filter *.docx | Out-Printer "\\Server01\Prt-6B Color"

Get all items in path with extension .docx pass to Out-Printer

More on Out-Printer

1 Comment

This is incorrect, OUT-PRINTER will only print TEXT output, it doesnt invoke WINWORD to run and print docx files as is required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.