How do I associate a filetype to open with a self developed application?












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?










share|improve this question
























  • Some similar issues. Try this answer.
    – Biswapriyo
    Dec 5 at 14:32
















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?










share|improve this question
























  • Some similar issues. Try this answer.
    – Biswapriyo
    Dec 5 at 14:32














1












1








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?










share|improve this question















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?







windows-10 pdf file-association code






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 at 15:04









Saaru Lindestøkke

66521032




66521032










asked Dec 5 at 14:01









SedoAdmin

61




61












  • Some similar issues. Try this answer.
    – Biswapriyo
    Dec 5 at 14:32


















  • Some similar issues. Try this answer.
    – Biswapriyo
    Dec 5 at 14:32
















Some similar issues. Try this answer.
– Biswapriyo
Dec 5 at 14:32




Some similar issues. Try this answer.
– Biswapriyo
Dec 5 at 14:32










1 Answer
1






active

oldest

votes


















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.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1381024%2fhow-do-i-associate-a-filetype-to-open-with-a-self-developed-application%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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.






    share|improve this answer


























      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.






      share|improve this answer
























        0












        0








        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 5 at 15:19









        Lewis M

        3175




        3175






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1381024%2fhow-do-i-associate-a-filetype-to-open-with-a-self-developed-application%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Сан-Квентин

            Алькесар

            Josef Freinademetz