In .NET/WinForms/C# I wrote a small program for "viewing" PDF files. It just opens a real PDF viewer and does some more things (not important for the following problem).

However, under Windows 10 I cannot set my program as the default for opening PDF files.
If I open a PDF file via "Open with..." and select my program and activate the option "Always open with...", next time I open a PDF Windows will use the default PDF viewer again.
In the case that I try to set the default program via the default apps settings, Windows will not even accept my program as a default for PDF files. It only shows other viewers like Acrobat or Chrome.

How can I set my self-coded program to be the default viewer for PDF files?

New contributor
SedoAdmin is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

I believe a combination of assoc and ftype will do the trick. You run the assoc command to associate an extension to a given ftype. You run the ftype command to specify what program to run when the given ftype is accessed.

Run

assoc /?

and

ftype /?

to get more info. If they work, I think you can put those commands in your login environment.

Hope this helps.

Your Answer

SedoAdmin is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.