Scripting.FileSystemObject.FileExists always returns false
1 answer
I suspect you are passing a relative path (eg "/Subfolder/Page.asp"). You need Server.MapPath , which is called on FileExists - which requires an absolute path (eg "C: \ inetpub \ Wwwroot \ subfolder \ Page.asp").
<%
Dim path : path = "/Admin/default.asp"
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(Server.MapPath(path)) Then
Server.Execute(path)
Else
Response.Write "The path " & path & " does not exist."
End If
Set fso = Nothing
%>
+2
source to share