IIS 7 AppCmd Example – Changing Default ISAPI Settings


  • Share on Pinterest

The default ISAPI settings in IIS 7 and later reference %windir% in the path. Changing these settings with a script using AppCmd requires special handling of the % character because it is a reserved character in the AppCmd utility. The % character is and operator to indicate the start of a Unicode character value.

To set values with extended characters using the IIS 7 AppCmd utility you must specify the Unicode value.

For example, to change the value of an ISAPI restriction from true to false on a setting with a relative path issue the command:

appcmd set config /section:system.webServer/security/isapiCgiRestriction /[path=’%u0025windir%u0025\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll”‘].allowed:false

The sequence %u0025 is the Unicode value of the % character.

r%u0025\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll”‘].allowed:true