I am trying to set up the same web site on multiple computers. I want to use a bat file to configure default documents. The site has several applications in different virtual directories that are directly under wwwroot. I am using appcmd like this:
"%windir%\system32\inetsrv\appcmd.exe" set config "Default Web Site/Mytest" -section:defaultDocument /+files.[@start,value='index.php'] /commit:"Default web site"
"%windir%\system32\inetsrv\appcmd.exe" set config "Default Web Site/Yourtest" -section:defaultDocument /+files.[@start,value='index.php'] /commit:"Default web site"
to set up two apps. This gives me the following web.config under wwwroot:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="Mytest">
<system.webServer>
<defaultDocument>
<files>
<add value="start.php" />
</files>
</defaultDocument>
</system.webServer>
</location>
<location path="Yourtest">
<system.webServer>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</location>
</configuration>
Slick (took me forever to get this far). ALMOST what I'm looking for. I could live with this but I'd like to add a clear element:
<files>
<clear />
<add value="index.php" />
</files>
to the config. Can anyone tell me how to do this using appcmd?