Results 1 to 3 of 3

Thread: [Resolved] Need help on asp/vbs script..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    www.alexdata.com
    Posts
    484

    [Resolved] Need help on asp/vbs script..

    I want to use the following script in a file:

    Set si = fso.OpenTextFile(Request.ServerVariables("PATH_TRANSLATED") & "NewFile.txt", 2, True)

    But my problem is that if i use this, then the output file will get a name like: "index.aspNewfile.txt"

    Simply because of the "path_translated" gives the total path and filename..

    So npw i wonder how an EASY way to SPLIT a variable containing the (Request.ServerVariables("PATH_TRANSLATED") info
    so that the last /filename.asp would go away!

    EG; it should make:

    c:\docs\net\index.asp to c:\docs\net\

    So that it reads the variable from end towards beginning and split at the first / i sees... Then removes everything from the end to the / ...

    Can anyone help me with a short short script for that !?!?!?
    Last edited by alexdata; Dec 3rd, 2002 at 02:58 PM.
    ***************
    Please use [highlight=vb] ..your code.. [/highlight] when posting code!

    When you have received the working answer to your question,
    please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.


    Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...

    Please Answer All Questions With Working Code Examples...


    My Unfinished Projects and My working Programs
    ***************

  2. #2
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    india
    Posts
    418
    hi,
    user server.mappath("filename") to solve this problem

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    www.alexdata.com
    Posts
    484

    Talking Thanks !!

    Thanks for your reply!

    I made it work thanks to you !!

    Code:
    <%
    dim fso,si
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set si = fso.OpenTextFile(server.mappath("TEST.TXT"), 2, True)
    si.writeline "Tested At: " & Now
    si.Close
    
    'with 2 in the line it OverWrite the file, with 8 it will ADD to the file
    %>
    ***************
    Please use [highlight=vb] ..your code.. [/highlight] when posting code!

    When you have received the working answer to your question,
    please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.


    Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...

    Please Answer All Questions With Working Code Examples...


    My Unfinished Projects and My working Programs
    ***************

Posting Permissions

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



Click Here to Expand Forum to Full Width