1

The appcmd help is a little vague and I can't seem to figure out the proper escape or quoting sequence.

appcmd set config -section:defaultDocument /-files.[value='main.html']

Remove a collection element with the specified keys in the
collection of the "system.webServer/defaultDocument" configuration section.

This works fine:

appcmd set config -section:system.webServer/rewrite/globalRules /-[name='rulename']

This does not:

appcmd set config -section:system.webServer/rewrite/globalRules /-[name='rule name']

The rule in question has multiple spaces and a forward slash (/) in the name.

MyItchyChin
  • 347
  • 1
  • 3
  • 12

1 Answers1

4

You should be able to delete using a combination of double and single quotes like:

appcmd.exe set config -section:system.webServer/rewrite/globalRules /-"[name='test rule with / in name']"

Try using Configuration Editor, it will generate the AppCmd.exe command automatically, it is included in IIS 7.5 and you can download it for IIS 7.0 at http://www.iis.net/download/AdministrationPack