Print all pdf files from a folder error: No file association

Tagged: , , ,

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Windows LiveUser62 Windows LiveUser62 11 months, 3 weeks ago.

  • Author
  • #31666
    Profile photo of Windows LiveUser62
    Windows LiveUser62

    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?

  • #31669
    Profile photo of Curtis Smith
    Curtis Smith

    Not really a PowerShell question, however, In windows 7

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

  • #31672
    Profile photo of Windows LiveUser62
    Windows LiveUser62

    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.

You must be logged in to reply to this topic.