WScript.Echo "Note, WEBSITE is the Web Site on which the directory will be created." WScript.Echo "The name can be specified as one of the following, in the priority specified:" WScript.Echo " Server Number (i.e. 1, 2, 10, etc.)" WScript.Echo " Server Description (i.e ""My Server"")" WScript.Echo " Server Host name (i.e. ""www.domain.com"")" WScript.Echo " IP Address (i.e., 127.0.0.1)" WScript.Echo "" WScript.Echo "" WScript.Echo "Example : mkwebdir -c MyComputer -w ""Default Web Site""" WScript.Echo " -v ""dir1"",""c:\inetpub\wwwroot\dir1"",""dir2"",""c:\inetpub\wwwroot\dir2"""
WScript.Quit End Sub '----------------------------------------------------------------
Sub ASTCreateVirtualWebDir(ComputerName,WebSiteName,DirNames,DirPaths) Dim Computer, webSite, WebSiteID, vRoot, vDir, DirNum On Error Resume Next
set webSite = findWeb(ComputerName, WebSiteName) if IsObject(webSite) then set vRoot = webSite.GetObject("IIsWebVirtualDir", "Root") Trace "Accessing root for " & webSite.ADsPath If (Err <> 0) Then Display "Unable to access root for " & webSite.ADsPath Else DirNum = 0 If (IsArray(DirNames) = True) And (IsArray(DirPaths) = True) And (UBound(DirNames) = UBound(DirPaths)) Then While DirNum < UBound(DirNames) 'Create the new virtual directory Set vDir = vRoot.Create("IIsWebVirtualDir",DirNames(DirNum)) If (Err <> 0) Then Display "Unable to create " & vRoot.ADsPath & "/" & DirNames(DirNum) &"."