All —
I have a vbscript running in an ASP page that I am trying to get to access a virtual directory in IIS 6. I can get the metapath of the site, but when the script tries to access the virt dir, I get a path can not be found error. Below is part of the code.. When I try to run it on the command line, I don’t get the error. Any suggestions?? The Wscript.echo lines are replaced with Resource.write for the web as well.
‘ Retrieve instance metabase path for root
dim a, a1
a=Request.ServerVariables(“INSTANCE_META_PATH”)
a1=Mid(“”& a &””,4)
Wscript.Echo “” & a1 &””
Set IIsWebVirtualDirObj = GetObject(“IIS://localhost”& a1 &”/Root/Scripts”)
If Err <> 0 Then
WScript.Echo Hex(Err.Number) & “: ” & Err.Description
WScript.Echo “Error connecting to Scripts.”
WScript.Quit(1)
End If
Thanks.
Mike