Bulk Printing files using Invoke Powershell

I tried to automate batch printing pdf files that I saved on a shared folder. I did not want to use hot keys to do this because it is very time consuming. So I tried to use powershell , I found a solution on the forum that did not work for me at thread to the link Print all files in a folder
They recommended using “print /d:<ServerName> filename” in invoke powershell but it did not work, I tried every way of passing as parameters, escaping quotes but failed. Finally I used “Start-Process” and its arguments which worked but I didn’t like the fact that Start-Process does not give you a standard error or success output and requires extra logic for closing Acrobat after print.

So I finally made Print work but I don’t understand how this is working… so I am passing device name as parameter name and file name as value of that parameter. Its like that invoke code is serially reading these values and running them. If I try to create 2 separate parameters for filename and device , it does not work!

This gave me major headache!


Make sure the checkbox for ‘IsScript’ is checked in the invoke power shell activity. The code in the thread you linked should work fine, just make sure that property is checked

1 Like

I was so sure I had checked it and at some point during test I didn’t. So this makes sense because since on this one I don’t have IsScript checked , it is serially taking in the name and value and appending it to the script. Thank You so much!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.