Dim 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