Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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 http://www.iis.net/download/AdministrationPack

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

 
discard

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.