You can access the IIS 5.1 metabase in VBScript, and this will allow you to create a virtual directory. For example, this should create a virtual directory called "TestDir" that points to the folder C: \ inetpub \ wwwroot \ Test
strComputer = "localhost" strVdirName = "TestDir" strVdirPath = "C:\Inetpub\wwwroot\Test" set objIIS = GetObject("IIS://" & strComputer & "/W3SVC/1") set objWebSite = objIIS.GetObject("IISWebVirtualDir","Root") set objVdir = objWebSite.Create("IISWebVirtualDir",strVdirName) objVdir.AccessRead = True objVdir.Path = strVdirPath objVdir.AppCreate (True) objVdir.SetInfo WScript.Echo "Successfully created virtual directory: " & objVdir.Name
Tim c source share