While building a new web server today I decided to see if there was a way to create Virtual Directories in IIS 6 from the command line. I had a bunch to create and wanted to script the creation for the next time I build a web server. I came across two vbscripts that are installed into c:\windows\system32 with IIS. This is the Microsoft article for the scripts.
IISWeb can be used to create, delete, start, stop, pause, and query websites. Just enter >iisweb /create c:\sitefolder “My Site” to create a site. There are also options to add ip address(/i ipaddress), host header(/d header), port (/b port), and options to set up a website on a remote computer. Just use /delete to delete the site.
IISvdir is the script to create and delete virtual directories. iisvdir /create “My Site” “Virtual Dir” c:\sitefolder\vdir will create a virtual directory named Virtual Dir in the web site My Site. Note that the website comes before the virtual directory name.
Unfortunatly I didn’t find any config options to setup other options in the site, but just these two in some scripts are going to save me tons of time.
0 Responses to “Create IIS6 Web Sites and Virtual Directories from the Command Line”
Leave a Reply