Discussion Locked

Getting 80070003 Error with vbscript

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

by none2345506585484

Hi Mike,
This error isn't exactly what's happening. It's more likely this is the result of a permissions issue for the virtual folder and/or the actual folder. Check the access permissions for these folders. The commandline works , because you are executing under your profile. The asp page will be using the ANON. profile.
Hope this helps

This discussion is closed to new replies.