Specifying AppCmd arguments with single quoteLoad-Balanced IIS 7.5 Web Server ASP.NET Session State problemset iis web farm with WFF and ARRFilter AppCmd to running sitesPsExec hangs intermittently when calling AppCmdConfiguring ODBCLogging on IIS 7.5nginx proxy_cache_key with a single $schemeNginx rule for single URL with .phpCan't find IIS config file listed by appcmdIssue with appcmd when attempting to list site and apppoolAD users in different sites on a single Domain

Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?

Change CPU MHz from Registry

Require advice on power conservation for backpacking trip

Was there ever a name for the weapons of the Others?

How to split an equation over two lines?

Using “sparkling” as a diminutive of “spark” in a poem

Animation advice please

What happens when I sacrifice a creature when my Teysa Karlov is on the battlefield?

Is adding a new player (or players) a DM decision, or a group decision?

Is there any set of 2-6 notes that doesn't have a chord name?

Can’t attend PhD conferences

Alphabet completion rate

Employer wants to use my work email account after I quit

First-year PhD giving a talk among well-established researchers in the field

What is the legal status of travelling with (unprescribed) methadone in your carry-on?

Impossible darts scores

Should I tell my insurance company I'm making payments on my new car?

What are the benefits of using the X Card safety tool in comparison to plain communication?

Are all instances of trolls turning to stone ultimately references back to Tolkien?

Are Finite Automata Turing Complete?

Would a two-seat light aircaft with a landing speed of 20 knots and a top speed of 180 knots be technically possible?

Links to webpages in books

What are the penalties for overstaying in USA?

How does a blind passenger not die, if driver becomes unconscious



Specifying AppCmd arguments with single quote


Load-Balanced IIS 7.5 Web Server ASP.NET Session State problemset iis web farm with WFF and ARRFilter AppCmd to running sitesPsExec hangs intermittently when calling AppCmdConfiguring ODBCLogging on IIS 7.5nginx proxy_cache_key with a single $schemeNginx rule for single URL with .phpCan't find IIS config file listed by appcmdIssue with appcmd when attempting to list site and apppoolAD users in different sites on a single Domain






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm attempting to configure a site in IIS on Windows 2016 using appcmd.exe. Specifically PHP and FastCGI. I'm running into an issue where specifying the arguments parameter with single quotes fails. I can't seem to figure out how to escape this or what incantation of quotes is required. Here's the command the does work:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /+"[fullPath='c:phpphp-cgi.exe', arguments='-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com', maxInstances='0', instanceMaxRequests='10000']" /commit:apphost


With open_basedir on Windows I need



-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com


to be enclosed in single quotes. Like this:



-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'


If I create the FastCGI application first without arguments, I can add them afterwards like this:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /[fullPath='c:phpphp-cgi.exe'].arguments:"-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'" /commit:apphost


This issue is that I can't change additional settings afterwards because I can't specify the single quoted path with appcmd.



I can accomplish this with the IIS Manager GUI and via C# code. So it's definitely possible to set it this way. I just can't seem to get the correct format for appcmd.










share|improve this question

















  • 1





    AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

    – Peter Hahndorf
    Jan 24 '18 at 16:08











  • I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

    – Deviation
    Jan 24 '18 at 17:12

















1















I'm attempting to configure a site in IIS on Windows 2016 using appcmd.exe. Specifically PHP and FastCGI. I'm running into an issue where specifying the arguments parameter with single quotes fails. I can't seem to figure out how to escape this or what incantation of quotes is required. Here's the command the does work:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /+"[fullPath='c:phpphp-cgi.exe', arguments='-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com', maxInstances='0', instanceMaxRequests='10000']" /commit:apphost


With open_basedir on Windows I need



-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com


to be enclosed in single quotes. Like this:



-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'


If I create the FastCGI application first without arguments, I can add them afterwards like this:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /[fullPath='c:phpphp-cgi.exe'].arguments:"-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'" /commit:apphost


This issue is that I can't change additional settings afterwards because I can't specify the single quoted path with appcmd.



I can accomplish this with the IIS Manager GUI and via C# code. So it's definitely possible to set it this way. I just can't seem to get the correct format for appcmd.










share|improve this question

















  • 1





    AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

    – Peter Hahndorf
    Jan 24 '18 at 16:08











  • I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

    – Deviation
    Jan 24 '18 at 17:12













1












1








1








I'm attempting to configure a site in IIS on Windows 2016 using appcmd.exe. Specifically PHP and FastCGI. I'm running into an issue where specifying the arguments parameter with single quotes fails. I can't seem to figure out how to escape this or what incantation of quotes is required. Here's the command the does work:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /+"[fullPath='c:phpphp-cgi.exe', arguments='-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com', maxInstances='0', instanceMaxRequests='10000']" /commit:apphost


With open_basedir on Windows I need



-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com


to be enclosed in single quotes. Like this:



-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'


If I create the FastCGI application first without arguments, I can add them afterwards like this:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /[fullPath='c:phpphp-cgi.exe'].arguments:"-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'" /commit:apphost


This issue is that I can't change additional settings afterwards because I can't specify the single quoted path with appcmd.



I can accomplish this with the IIS Manager GUI and via C# code. So it's definitely possible to set it this way. I just can't seem to get the correct format for appcmd.










share|improve this question














I'm attempting to configure a site in IIS on Windows 2016 using appcmd.exe. Specifically PHP and FastCGI. I'm running into an issue where specifying the arguments parameter with single quotes fails. I can't seem to figure out how to escape this or what incantation of quotes is required. Here's the command the does work:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /+"[fullPath='c:phpphp-cgi.exe', arguments='-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com', maxInstances='0', instanceMaxRequests='10000']" /commit:apphost


With open_basedir on Windows I need



-d open_basedir=E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com


to be enclosed in single quotes. Like this:



-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'


If I create the FastCGI application first without arguments, I can add them afterwards like this:



%windir%system32inetsrvappcmd.exe set config /section:system.webServer/fastCGI /[fullPath='c:phpphp-cgi.exe'].arguments:"-d open_basedir='E:Webwww.example.com;E:Sessionswww.example.com;E:Logswww.example.com;E:Tempwww.example.com'" /commit:apphost


This issue is that I can't change additional settings afterwards because I can't specify the single quoted path with appcmd.



I can accomplish this with the IIS Manager GUI and via C# code. So it's definitely possible to set it this way. I just can't seem to get the correct format for appcmd.







windows iis web-hosting windows-server-2016 web






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 24 '18 at 15:16









DeviationDeviation

61 bronze badge




61 bronze badge







  • 1





    AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

    – Peter Hahndorf
    Jan 24 '18 at 16:08











  • I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

    – Deviation
    Jan 24 '18 at 17:12












  • 1





    AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

    – Peter Hahndorf
    Jan 24 '18 at 16:08











  • I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

    – Deviation
    Jan 24 '18 at 17:12







1




1





AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

– Peter Hahndorf
Jan 24 '18 at 16:08





AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use Configuration Editor in the GUI to make your changes and then have a look at the generated AppCmd command using the Generate Script dialog.

– Peter Hahndorf
Jan 24 '18 at 16:08













I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

– Deviation
Jan 24 '18 at 17:12





I realize it's older, but it's still supported as far as I can tell. It's also scattered through many scripts in the organization. I didn't really want to rewrite everything in PowerShell. FWIW, appcmd has the same single quote issue on 2008 R2.

– Deviation
Jan 24 '18 at 17:12










1 Answer
1






active

oldest

votes


















0














I ran across your question while trying to find the same answer. I discovered a workaround and wanted to let you know.



Use the XML i/o feature of appcmd.exe. On a site with the proper headers, run appcmd list config /section:httpProtocol /xml > addheaders.xml and save the output file.
On another system, you can run appcmd set config /in < addheaders.xml



I'm sure you can find a way to include the xml inside the script if you don't want to rely on an extra file.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    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%2fserverfault.com%2fquestions%2f893895%2fspecifying-appcmd-arguments-with-single-quote%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 ran across your question while trying to find the same answer. I discovered a workaround and wanted to let you know.



    Use the XML i/o feature of appcmd.exe. On a site with the proper headers, run appcmd list config /section:httpProtocol /xml > addheaders.xml and save the output file.
    On another system, you can run appcmd set config /in < addheaders.xml



    I'm sure you can find a way to include the xml inside the script if you don't want to rely on an extra file.






    share|improve this answer



























      0














      I ran across your question while trying to find the same answer. I discovered a workaround and wanted to let you know.



      Use the XML i/o feature of appcmd.exe. On a site with the proper headers, run appcmd list config /section:httpProtocol /xml > addheaders.xml and save the output file.
      On another system, you can run appcmd set config /in < addheaders.xml



      I'm sure you can find a way to include the xml inside the script if you don't want to rely on an extra file.






      share|improve this answer

























        0












        0








        0







        I ran across your question while trying to find the same answer. I discovered a workaround and wanted to let you know.



        Use the XML i/o feature of appcmd.exe. On a site with the proper headers, run appcmd list config /section:httpProtocol /xml > addheaders.xml and save the output file.
        On another system, you can run appcmd set config /in < addheaders.xml



        I'm sure you can find a way to include the xml inside the script if you don't want to rely on an extra file.






        share|improve this answer













        I ran across your question while trying to find the same answer. I discovered a workaround and wanted to let you know.



        Use the XML i/o feature of appcmd.exe. On a site with the proper headers, run appcmd list config /section:httpProtocol /xml > addheaders.xml and save the output file.
        On another system, you can run appcmd set config /in < addheaders.xml



        I'm sure you can find a way to include the xml inside the script if you don't want to rely on an extra file.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 7 at 15:02









        Rick McClintonRick McClinton

        1




        1



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • 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%2fserverfault.com%2fquestions%2f893895%2fspecifying-appcmd-arguments-with-single-quote%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

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos