0

I created a script using appcmd.exe to setup my FastCGI application in IIS. They work but I am unsure about a few details. Some of the options in the below commands have been shortened for clarity.

Some of the command details start with a slash and some with a dash. Which is the preferred style? Also, I am not clear on which ones require /commit and which do not. Note that I have a delete command so that I can run the script multiple times.

appcmd.exe delete vdir /vdir.name:"Default Web Site/pbcgi"

appcmd.exe add vdir /app.name:"Default Web Site/" /path:/pbcgi /physicalPath:"C:\TopwizWeb"

appcmd.exe set config /section:system.webServer/handlers /accessPolicy:Read,Script,Execute /commit:apphost

appcmd.exe clear config -section:system.webServer/handlers -"[name='TopwizWeb FastCGI']"

appcmd.exe set config -section:system.webServer/handlers /+"[name='TopwizWeb FastCGI', path='*.pbcgi']"

appcmd.exe clear config -section:system.webServer/fastCgi -"[fullPath='C:..\TopwizWeb.exe']"

appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='C:..\TopwizWeb.exe', maxInstances='4']" /commit:apphost

1
  • Microsoft didn't document this command clearly for decades, so you shouldn't expect anything more. Whether to use /commit depends on in which configuration file you would like to see the settings to be applied. For most settings, they can be added to different locations/files, so /commit gives you an option to choose a specific file. Commented Feb 15, 2022 at 4:49

1 Answer 1

0

You have asked, "Some of the command details start with a slash and some with a dash. Which is the preferred style?"

I try to refer to official documents.

  1. Getting Started with AppCmd.exe
  2. AppCmd.exe

The first link shows the use of '/' whereas the second link shows the use of '-' with the parameters of the Appcmd command.

While checking other online articles, I noticed the majority of the article shows examples using '/'.

As both ways are supported, you could prefer which is suitable for you.

If we talk about the /commit then it is used for controlling the location of configuration changes.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.