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.

1
  • Did you try "rule%20name"? I don't know if it will work but I would try it Jul 23, 2010 at 3:59

1 Answer 1

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .