Click to See Complete Forum and Search --> : Server.MapPath


fromhell
10-19-2008, 11:45 PM
hi guys,
i got a prob when try use Server.MapPath to find a folder name include & character ( for example: Picture 2008 & 2009).
can someone help me with this

error:
Microsoft VBScript runtime error '800a004c'

Path not found


Code :
strPhysicalPath = Server.MapPath(".\" & ShowSub)
If ShowSub > " " then
ShowSub = Replace(ShowSub, " ", "%20")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files

sstalder
10-20-2008, 11:53 AM
What happens when you try this:

strPhysicalPath = Server.MapPath(Server.URLEncode(ShowSub))

If ShowSub > " " then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files

fromhell
10-20-2008, 08:47 PM
What happens when you try this:

strPhysicalPath = Server.MapPath(Server.URLEncode(ShowSub))

If ShowSub > " " then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files


still got an error
but thank you sstalder.
it already solved
i put some replace command like this:

ShowSub = Replace(ShowSub, "&", "%26")