Beginner Question: Using Mappath

Results 1 to 2 of 2

Thread: Beginner Question: Using Mappath

  1. #1
    Sue Crocker Guest

    Default Beginner Question: Using Mappath

    Ok, beginner user question.<BR>How do I use mappath to point to a file in a different directory?<BR><BR>Example: jnk.asp has:<BR><BR>set act = fso.opentextfile(server.mappath("asp_count.txt"))< BR><BR>Well, that works if my asp is in the same directory, but what if asp_count.txt is in the counter directory one directory below where the asp file is stored?<BR><BR>What would go into .mappath?<BR><BR>Thanks in advance.<BR><BR>Sue

  2. #2
    Rob Guest

    Default RE: Beginner Question: Using Mappath

    Try this<BR><BR> &#060;%<BR> Dim MyFSO<BR> Dim MyTXT<BR> Dim MyFileVar<BR><BR> Set MyFSO = Server.CreateObject("Scripting.FileSystemObject")< BR> Set MyTXT = MyFSO.OpenTextFile(MyFileVar, 1, True)<BR> MyFileVar = Server.MapPath("MyDir/SubDir1/SubDir2/MyFile.txt")<BR><BR> etc.. etc..<BR> %&#062;<BR><BR>

Posting Permissions

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