home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
CHIPCD_9_99.iso
/
software
/
uaktualnienia
/
OptionPackPL
/
iis4_07.cab
/
fixcfg.vbs
< prev
next >
Wrap
Text File
|
1998-04-27
|
2KB
|
75 lines
Option Explicit
On Error Resume Next
Const Error_NoNode = "Unable to open "
Dim oArgs, ArgNum, propNum, ArgPath
Dim ArgComputers, WebDirList
propNum = 0
ArgNum = 0
ArgComputers = Array("LocalHost")
WebDirList = Array("IISHELP/ado", "IISHELP/adc", "IISHELP/msadc",_
"IISHELP/ics", "msadc","IISHELP/SSE/SA","IISHELP/SSE/UA Express","IISHELP/ics/I_cmak",_
"IISHELP/ics/I_cps","IISHELP/ics/I_ias", "CertSrv", "CertQue", "CertAdm", "CertControl")
Set oArgs = WScript.Arguments
While ArgNum < oArgs.Count
Select Case LCase(oArgs(ArgNum))
Case "--computer","-c":
ArgNum = ArgNum + 1
ArgComputers = Split(oArgs(ArgNum), ",", -1)
Case "--help","-?":
Call DisplayUsage
Case Else:
Call DisplayUsage
End Select
ArgNum = ArgNum + 1
Wend
Dim compIndex
for compIndex = 0 to UBound(ArgComputers)
Call FixCfg(ArgComputers(compIndex))
next
SUB FixCfg(Computer)
On Error Resume Next
Dim oAdmin, fullPath, node, dir, i
for i = 0 to UBound(WebDirList)
dir = WebDirList(i)
fullPath = "IIS://"&Computer&"/W3svc/1/Root/"&dir
set node = GetObject(fullPath)
If Err.Number <> 0 Then
Display Error_NoNode & dir
Err.Clear
Else
Trace "Setting "&dir& " to Virtual Directory."
node.KeyType = "IIsWebVirtualDir"
node.SetInfo
If Err.Number <> 0 Then
Display "Unable to mark " & dir & " as Virtual Directory"
Err.Clear
end if
End If
next
Trace "Done fixing Configuration for "&Computer
End Sub
Sub Display(Msg)
WScript.Echo "Error Code: " & Hex(Err) & " - " & Msg
End Sub
Sub Trace(Msg)
WScript.Echo Msg
End Sub
Sub DisplayUsage
WScript.Echo "Usage: fixCfg [--computer|-c COMPUTER1[,COMPUTER2...]]"
WScript.Quit (1)
End Sub