Teddy
Teddy

Reputation: 143

How to print files from folder > subfolder with powershell

I need to print more than 100 files that are in folder like that :

I actually try to do this with powershell with an algorithm that will look at in every folder and print each files in each folder.

Can someone help me with that ? Thanks you !

Upvotes: 1

Views: 633

Answers (1)

Nicicalu
Nicicalu

Reputation: 795

You can use the cmdlet Start-Proccess with the parameter -Verb print. This one line of code should do the job. This will print every file in the given folder on the default printer.

Get-Childitem "path\to\folder" -Recurse | where { ! $_.PSIsContainer } | %{ Start-Process -FilePath $_.Fullname -Verb print}

Please test it and let me know if it worked.

Upvotes: 1

Related Questions