The following script will allow you to set the LogFileDirectory for a specific Web Site. The script currently is set to apply this change to the Default Web Site - Web Site Instance ID 1Dim ServerObj, LogFileDirectory, Path, ServerName, WebSiteID
on error resume next
ServerName = "Localhost"
WebSiteID = 1
WebPath = "IIS://" & ServerName & "/W3SVC/" & WebSiteID
LogFiledirectory = "C:\Temp"
Set ServerObj = GetObject(WebPath )
if (Err <> 0) then
WScript.Echo "Unable to read the " & WebPath & " IIS object"
WScript.Quit(1)
end if
ServerObj.LogFileDirectory = LogfileDirectory
ServerObj.SetInfo
if (Err <> 0) then
WScript.Echo "Unable to set the Log File Directory: Err=" & Err.Description & " (" & Err & ")"
else
WScript.Echo "LogFileDirectory set to " & LogFileDirectory & " for " & WebPath
end if
|