vbscript assist 2RSS

3 replies

Last post Sep 22, 2004 12:37 PM by jaswild

  • vbscript assist 2

    Sep 21, 2004 04:45 PM|jaswild|LINK

    Ok, I've written an ASP page that performs the following: If Request.QueryString("src") = "" Then src = "\\server\share$\" Else src = Request.QueryString("src") End If Set recroot = fs.GetFolder(src) Set clientfolders = recroot.SubFolders Basically, what happens is that this generates links based on what folders exist in that share, and allows a user to go through the folders. What happens is I get a folder UNC like this - \\server\share$\client\sub\Southern & Broadway\ The problem is the '&' character in the folder name, when it get's passed back and is picked up under the 'Else' above, it stops the path at the '&' character and errors out on the page. There a code workaround someone wouldn't mind sharing?
  • Re: vbscript assist 2

    Sep 21, 2004 08:50 PM|mbaldwin|LINK

    One option is to convert it to 8.2 and see if that works, i.e. SOUTHE~1. -matt
  • Re: vbscript assist 2

    Sep 22, 2004 08:31 AM|tomkmvp|LINK

    You probably need to Server.URLEncode the "&" so when it's passed in the querystring it's interpreted as data and not a delimiter. The ampersand has a special meeting when used in a URL - it seperates name/value pairs as in ... process.asp?varA=val1&varB=val2&varC= ...
    Tom Kaminski (former IIS MVP 2002-2010)
    http://mvp.support.microsoft.com/
  • Re: vbscript assist 2

    Sep 22, 2004 11:42 AM|jaswild|LINK

    Thank you both for your replies. Server.URLencode was just what was needed. Thanks Tom.