I need clarification about appcmd commands

592 Views Asked by At

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

There are 1 best solutions below

0
Deepak-MSFT On

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