Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Did you try "rule%20name"? I don't know if it will work but I would try it – jer.salamon Jul 23 '10 at 3:59
up vote 4 down vote accepted

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

share|improve this answer
That did it, thanks! – MyItchyChin Jul 23 '10 at 18:41
Thanks for the tip on Configuration Editor. – Mike Jan 7 '13 at 19:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.