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

This topic contains 2 replies, has 2 voices, and was last updated by  Windows LiveUser62 1 year, 11 months ago.

  • Author
    Posts
  • #31666

    Windows LiveUser62
    Participant

    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

    Curtis Smith
    Participant

    Not really a PowerShell question, however, In windows 7

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

  • #31672

    Windows LiveUser62
    Participant

    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.