问题
I am creating an automatic deployment script and need to create an IIS Virtual Directory from the configuration file which is created when you Right-Click the virtual directory and select "All Tasks > Save Configuration to a File"
Save Configuration To File http://img5.imageshack.us/img5/7200/saveconfigurationtofile.gif
I have done some reading and know there is a script included with Microsoft Windows Server called "IISVDIR.VBS" but this doesn't seem to take this configuration file as an argument, so you have to fill in everything yourself.
The only way I know that you can create a Virtual Directory from this configuration file is to select "New > Virtual Directory (from file)...".
Does anyone know if it is possible to automate this?
回答1:
To use IISVDIR.VBS you need to pass it as an argument to cscript.exe which also comes with Windows Server. The only example I have of its usage is to delete a virtual directory using the /delete switch, however I'm sure you can add in a similar way.
来源:https://stackoverflow.com/questions/1062164/using-batch-file-to-create-iis-virtual-directory-from-config-file