Applying a command line argument to the binary exe when double click on the file











up vote
0
down vote

favorite












On windows, I have modified a shortcut to an exe file in order to apply a command line argument for that. So, in the properties of the shortcut, I have written



D:texlive2018binwin32texworks.exe -stylesheet pathtomystyle.css


When I double click on the shortcut, I can verify that the argument has been applied. Problem is that when I double click on foo.tex, it will automatically use D:texlive2018binwin32texworks.exe and not the argument that I defined.



I even right clicked on foo.tex and changed the "open with" to shortcut path instead of D:texlive2018binwin32texworks.exe. Still the argument is missing when I try to open the tex file directly.



Please see the pictures below



enter image description here



and



enter image description here



Any thought?










share|improve this question






















  • Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
    – Appleoddity
    Nov 25 at 15:20










  • The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
    – mahmood
    Nov 25 at 18:48










  • Sorry, was pulling that from memory. I wrote some further details in an answer.
    – Appleoddity
    Nov 25 at 20:00















up vote
0
down vote

favorite












On windows, I have modified a shortcut to an exe file in order to apply a command line argument for that. So, in the properties of the shortcut, I have written



D:texlive2018binwin32texworks.exe -stylesheet pathtomystyle.css


When I double click on the shortcut, I can verify that the argument has been applied. Problem is that when I double click on foo.tex, it will automatically use D:texlive2018binwin32texworks.exe and not the argument that I defined.



I even right clicked on foo.tex and changed the "open with" to shortcut path instead of D:texlive2018binwin32texworks.exe. Still the argument is missing when I try to open the tex file directly.



Please see the pictures below



enter image description here



and



enter image description here



Any thought?










share|improve this question






















  • Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
    – Appleoddity
    Nov 25 at 15:20










  • The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
    – mahmood
    Nov 25 at 18:48










  • Sorry, was pulling that from memory. I wrote some further details in an answer.
    – Appleoddity
    Nov 25 at 20:00













up vote
0
down vote

favorite









up vote
0
down vote

favorite











On windows, I have modified a shortcut to an exe file in order to apply a command line argument for that. So, in the properties of the shortcut, I have written



D:texlive2018binwin32texworks.exe -stylesheet pathtomystyle.css


When I double click on the shortcut, I can verify that the argument has been applied. Problem is that when I double click on foo.tex, it will automatically use D:texlive2018binwin32texworks.exe and not the argument that I defined.



I even right clicked on foo.tex and changed the "open with" to shortcut path instead of D:texlive2018binwin32texworks.exe. Still the argument is missing when I try to open the tex file directly.



Please see the pictures below



enter image description here



and



enter image description here



Any thought?










share|improve this question













On windows, I have modified a shortcut to an exe file in order to apply a command line argument for that. So, in the properties of the shortcut, I have written



D:texlive2018binwin32texworks.exe -stylesheet pathtomystyle.css


When I double click on the shortcut, I can verify that the argument has been applied. Problem is that when I double click on foo.tex, it will automatically use D:texlive2018binwin32texworks.exe and not the argument that I defined.



I even right clicked on foo.tex and changed the "open with" to shortcut path instead of D:texlive2018binwin32texworks.exe. Still the argument is missing when I try to open the tex file directly.



Please see the pictures below



enter image description here



and



enter image description here



Any thought?







windows file-management






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 at 13:43









mahmood

3404922




3404922












  • Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
    – Appleoddity
    Nov 25 at 15:20










  • The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
    – mahmood
    Nov 25 at 18:48










  • Sorry, was pulling that from memory. I wrote some further details in an answer.
    – Appleoddity
    Nov 25 at 20:00


















  • Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
    – Appleoddity
    Nov 25 at 15:20










  • The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
    – mahmood
    Nov 25 at 18:48










  • Sorry, was pulling that from memory. I wrote some further details in an answer.
    – Appleoddity
    Nov 25 at 20:00
















Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
– Appleoddity
Nov 25 at 15:20




Go in to the registry under HKCR.tex look for the ‘open with’ key and you will see the command used to open .tex files. Add your extra parameters. Log off and log back on to the computer.
– Appleoddity
Nov 25 at 15:20












The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
– mahmood
Nov 25 at 18:48




The .tex folder has one default key with the value of TL.TeXworks.edit.2018. There is a subfolder named OpenWithProglds and there I see a default key which is not set and another key TL.TeXworks.edit.2018 which is empty.
– mahmood
Nov 25 at 18:48












Sorry, was pulling that from memory. I wrote some further details in an answer.
– Appleoddity
Nov 25 at 20:00




Sorry, was pulling that from memory. I wrote some further details in an answer.
– Appleoddity
Nov 25 at 20:00










1 Answer
1






active

oldest

votes

















up vote
1
down vote













To modify the command used to open a certain file type you will need to go in to regedit.



Perform the following within regedit:




  • Navigate to HKLMSoftwareClasses.texOpenWithProgids - Make note of the name of the application listed.

  • Navigate to HKLMSoftwareClasses<Name of Program from previous step>shellOpencommand


Here, you find a (Default) key with the command line used to open that type of file. Specifically, the <path> and <name> of the executable will be enclosed in double-quotes followed by, usually, a "%1" which will be replaced by the <path> and <name> of the file when you try to open it.





  • Double-click to edit the (Default) key, then move to the end of the line. Add a [space] and then add your additional command line parameters. Any parameter that has a space in it should be enclosed within double-quotes to indicate it is one parameter and not multiple. i.e.



    -stylesheet "pathtomystyle.css"




Close regedit, then logoff and log back on to your computer and test.



Note: The instructions above aren't universal, but for most third party applications with associated file types you'll see this layout. Some special applications like Microsoft Office do things differently.






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',
    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%2f1378222%2fapplying-a-command-line-argument-to-the-binary-exe-when-double-click-on-the-file%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








    up vote
    1
    down vote













    To modify the command used to open a certain file type you will need to go in to regedit.



    Perform the following within regedit:




    • Navigate to HKLMSoftwareClasses.texOpenWithProgids - Make note of the name of the application listed.

    • Navigate to HKLMSoftwareClasses<Name of Program from previous step>shellOpencommand


    Here, you find a (Default) key with the command line used to open that type of file. Specifically, the <path> and <name> of the executable will be enclosed in double-quotes followed by, usually, a "%1" which will be replaced by the <path> and <name> of the file when you try to open it.





    • Double-click to edit the (Default) key, then move to the end of the line. Add a [space] and then add your additional command line parameters. Any parameter that has a space in it should be enclosed within double-quotes to indicate it is one parameter and not multiple. i.e.



      -stylesheet "pathtomystyle.css"




    Close regedit, then logoff and log back on to your computer and test.



    Note: The instructions above aren't universal, but for most third party applications with associated file types you'll see this layout. Some special applications like Microsoft Office do things differently.






    share|improve this answer

























      up vote
      1
      down vote













      To modify the command used to open a certain file type you will need to go in to regedit.



      Perform the following within regedit:




      • Navigate to HKLMSoftwareClasses.texOpenWithProgids - Make note of the name of the application listed.

      • Navigate to HKLMSoftwareClasses<Name of Program from previous step>shellOpencommand


      Here, you find a (Default) key with the command line used to open that type of file. Specifically, the <path> and <name> of the executable will be enclosed in double-quotes followed by, usually, a "%1" which will be replaced by the <path> and <name> of the file when you try to open it.





      • Double-click to edit the (Default) key, then move to the end of the line. Add a [space] and then add your additional command line parameters. Any parameter that has a space in it should be enclosed within double-quotes to indicate it is one parameter and not multiple. i.e.



        -stylesheet "pathtomystyle.css"




      Close regedit, then logoff and log back on to your computer and test.



      Note: The instructions above aren't universal, but for most third party applications with associated file types you'll see this layout. Some special applications like Microsoft Office do things differently.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        To modify the command used to open a certain file type you will need to go in to regedit.



        Perform the following within regedit:




        • Navigate to HKLMSoftwareClasses.texOpenWithProgids - Make note of the name of the application listed.

        • Navigate to HKLMSoftwareClasses<Name of Program from previous step>shellOpencommand


        Here, you find a (Default) key with the command line used to open that type of file. Specifically, the <path> and <name> of the executable will be enclosed in double-quotes followed by, usually, a "%1" which will be replaced by the <path> and <name> of the file when you try to open it.





        • Double-click to edit the (Default) key, then move to the end of the line. Add a [space] and then add your additional command line parameters. Any parameter that has a space in it should be enclosed within double-quotes to indicate it is one parameter and not multiple. i.e.



          -stylesheet "pathtomystyle.css"




        Close regedit, then logoff and log back on to your computer and test.



        Note: The instructions above aren't universal, but for most third party applications with associated file types you'll see this layout. Some special applications like Microsoft Office do things differently.






        share|improve this answer












        To modify the command used to open a certain file type you will need to go in to regedit.



        Perform the following within regedit:




        • Navigate to HKLMSoftwareClasses.texOpenWithProgids - Make note of the name of the application listed.

        • Navigate to HKLMSoftwareClasses<Name of Program from previous step>shellOpencommand


        Here, you find a (Default) key with the command line used to open that type of file. Specifically, the <path> and <name> of the executable will be enclosed in double-quotes followed by, usually, a "%1" which will be replaced by the <path> and <name> of the file when you try to open it.





        • Double-click to edit the (Default) key, then move to the end of the line. Add a [space] and then add your additional command line parameters. Any parameter that has a space in it should be enclosed within double-quotes to indicate it is one parameter and not multiple. i.e.



          -stylesheet "pathtomystyle.css"




        Close regedit, then logoff and log back on to your computer and test.



        Note: The instructions above aren't universal, but for most third party applications with associated file types you'll see this layout. Some special applications like Microsoft Office do things differently.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 25 at 19:56









        Appleoddity

        6,86621024




        6,86621024






























            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%2f1378222%2fapplying-a-command-line-argument-to-the-binary-exe-when-double-click-on-the-file%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

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...