Getting current directory name

Results 1 to 3 of 3

Thread: Getting current directory name

  1. #1
    Adrian Guest

    Default Getting current directory name

    I am trying to get the current dir name. One thing I tried was:<BR><BR>Dim sScriptDir<BR>sScriptDir = Request.ServerVariables("URL")<BR>sScriptDir = StrReverse(sScriptDir)<BR>sScriptDir = Mid(sScriptDir, InStr(sScriptDir, "/"))<BR>sScriptDir = StrReverse(sScriptDir)<BR>response.write sScriptDir<BR><BR>but it gives me the whole path after the root. Which would require knowing how to strip off parent folder names.<BR><BR>I also looked at the FileSystemObject Folder.Name property but couldn&#039t glean the information out of the MS tutorial. Which is more elegant, and which one will let me use the variable for dynamic links.<BR><BR>Thanks<BR>Adrian

  2. #2
    Keith Fowler Guest

    Default RE: Getting current directory name

    Try:<BR><BR>sScriptDir= Request.ServerVariables("MAP_PATH")<BR><BR>Respons e.Write sScriptDir<BR><BR>I am not sure if this will produce exactly what your looking for, but String manipulation may be a little easier for you.<BR>

  3. #3
    Keith Fowler Guest

    Default Gave worng response (This ones right) Getting curr

    sScriptPath= Request.ServerVariables("PATH_INFO")<BR>sScriptDir = Server.MapPath(sScriptPath)<BR><BR>Response.Write sScriptDir<BR><BR>Please forgive me for misleading you the first time. I apologize.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts