Author Posts

November 4, 2015 at 9:01 am

I try to print all pdf files from a folder:
Dir D:\test\*.pdf | Foreach-Object { Start-Process -FilePath $_.FullName –Verb Print }
It works fine for *.docx files, but for *.pdf I get an error saying that there is no associated program. I would like the pdf files to be opened in Microsoft Edge, so I don't need to install a separate pdf reader program.
How can I see which program *.pdf files are associated with?

November 4, 2015 at 9:40 am

Not really a PowerShell question, however, In windows 7

Control Panel\All Control Panel Items\Default Programs\Set Associations

November 4, 2015 at 9:52 am

Thank you very much for your answer. I had to install a pfd reader program, because I could not find any way to print pdf from Microsoft Edge. (Windows 10)
Get-ItemProperty "Registry::HKEY_CLASSES_ROOT\pdf\shell\open\command" "(Default)"
was empty, "'HKEY_CLASSES_ROOT\pdf\shell\open\command' because it does not exist"
Problem solved by installing a pdf reader. Pity it could not be done with Microsoft Edge/Powershell.