1

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?

1 Answers1

0

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.

Lewis M
  • 377