Printing with Powershell and files in folders

Question:

I have a script which does some onsite printing. It doesnt work too well at the moment as the below runs for various file types which are sent to a folder to print, but the problem is it will only print 1 document at a time.

I had the idea of doing this to get around it:

This doesnt seem to work though. So then i tried this:

Also no luck,

Returns this error:

I think i am maybe not visualing the process here. Any ideas at all anyone on how to achieve printing of every file in a folder via powershell?

Windows 7 64 bit and $PSVersion = 5.0

Thanks in advance

Answer:

You are very close, start-process needs the full path and name of the file:


Using a foreach loop should help you too:

Source:

Printing with Powershell and files in folders by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply