- - - - -
Option Explicit
Dim DirPath
Dim WebPath
Dim defaultDocName
Dim www
Dim app
DirPath = Session.Property("INSTALLDIR") & "Web\"
MsgBox DirPath
WebPath = "TRS"
defaultDocName = "default.asp"
Set www = GetObject("IIS://LOCALHOST/W3SVC/1/Root")
If Err.Number <> 0 Then
MsgBox "An error occured while creating the website." & vbCrLf & Err.Number & vbCrLf & Err.Source & vbCrLf & Err.Description, 16
else
Set app = www.Create("IISWebVirtualDir", WebPath)
If Err.Number <> 0 Then
MsgBox "An error occured while creating the website." & vbCrLf & Err.Number & vbCrLf & Err.Source & vbCrLf & Err.Description, 16
else
app.AppRoot = "/LM/W3SVC/1/Root/" + WebPath
app.AppFriendlyName = WebPath
app.AppAllowDebugging = False
app.AccessExecute = True
app.AspBufferingOn = True
app.AspScriptTimeout = 900
app.AccessScript = True
app.Path = dirPath
app.Defaultdoc = defaultDocName
app.SetInfo
MsgBox "The TRS web site has been created.", 64
End If
End If
Set app = Nothing
Set www = Nothing