用VBS创建IIS虚拟站点实例
' ---------------------------------------------------------------------------' Creates or deletes the virtual directory http://localhost/channel7
'
' Valid command line switches: -i -u -q
' -i Install virtual directory
' -u Remove virtual directory
' -q Run in quiet mode
'
' ---------------------------------------------------------------------------
' See http://www.microsoft.com/windows2000/en/advanced/iis/default.asp?url=/windows2000/en/advanced/iis/htm/asp/aore8v5e.htm
Option Explicit
Dim vPath,vName, vWshShell, vObjArgs, vInstall, vRemove, vQuiet, i
vName = "channel7"
' get current path to folder
vPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "", 15) - 1)
vPath = vPath & "owbase"
'Set WshShell = WScript.CreateObject("WScript.Shell")
'vPath = WshShell.RegRead("HKLMSoftwarechannel7") & "owbase"
vQuiet = False
vInstall = False
vRemove = False
Set vObjArgs = WScript.Arguments
For i = 0 To vObjArgs.Count - 1
If InStr(LCase(vObjArgs(i)), "i") <> 0 Then
vInstall = True
Elseif InStr(LCase(vObjArgs(i)), "u") <> 0 Then
vRemove = True
End If
If InStr(LCase(vObjArgs(i)), "q") <> 0 Then
vQuiet = True
End If
Next
If vRemove Then
DeleteVDir vName
Elseif vInstall Then
CreateVDir vName, vPath
End If
Sub CreateVDir(pName, pPath)
Dim vRoot, vBaseDir, vWebSite, ipSecurityObj, ipList
On Error Resume Next
' get the local host default web
补充:asp教程,高级应用