Print using Foxit in PowerShell

1.3k Views Asked by At

I am trying to get a PowerShell script to work to print out multiple documents to the default printer. Any ideas on what I can do to get this to work?

$files = Get-ChildItem -Filter "*.pdf"
foreach ($file in $files) {
    "c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /t $file
}
1

There are 1 best solutions below

0
On

Use the parameter /p for printing to the default printer, use the call operator (&) for executing command paths in quotes.

Change this line:

"c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /t $file

into this:

& "c:\Program Files (x86)\Foxit Software\Foxit Reader\FoxitReader.exe" /p $file