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;
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
add a comment |
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
1
AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to useConfiguration Editorin the GUI to make your changes and then have a look at the generated AppCmd command using theGenerate Scriptdialog.
– 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
add a comment |
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
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
windows iis web-hosting windows-server-2016 web
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 useConfiguration Editorin the GUI to make your changes and then have a look at the generated AppCmd command using theGenerate Scriptdialog.
– 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
add a comment |
1
AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to useConfiguration Editorin the GUI to make your changes and then have a look at the generated AppCmd command using theGenerate Scriptdialog.
– 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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 7 at 15:02
Rick McClintonRick McClinton
1
1
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
AppCmd.exe is a legacy program, have you considered using PowerShell to configure IIS? You can also try to use
Configuration Editorin the GUI to make your changes and then have a look at the generated AppCmd command using theGenerate Scriptdialog.– 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