Path info for VBscript from HTM page

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ko Vijn (ko_at_nothere.nnr)
Date: 04/25/04


Date: Sun, 25 Apr 2004 18:44:41 +0200

I would like to run a vbscript from a html page on my website.
Being new to this game I made something like:

 Set fso = CreateObject("Scripting.FileSystemObject")
 set f=fso.opentextfile("mytext.txt", 8, true)
 f.writeLine "this is new text"
 f.close

This script was placed in a html file (under Frontpage), located in folder
c:\my documents\myweb.

The script runs fine, but the file mytext.txt is placed in the folder
C:\Documents and Setting/MyName, when I run the script under Frontpage, and
it is put on my Desktop when I run the script from the HTML file. When I
upload the html file to my website and run the script I get an error.

Neither is what I want, because basically I want to access (for read and/or
write) a textfile located in the folder with my html document with the
script in it, be it local on my PC or on my Website.

So, if my_file.html (with a script in it) how do I retrieve its absolute or
relative path, when it can sit on my PC or the Website with my provider

Thanks for any suggestions.
Ko Vijn



Relevant Pages

  • Re: Path info for VBscript from HTM page
    ... > I would like to run a vbscript from a html page on my website. ... > This script was placed in a html file, ... > it is put on my Desktop when I run the script from the HTML file. ... > upload the html file to my website and run the script I get an error. ...
    (microsoft.public.scripting.vbscript)
  • Re: Making a counter for a web page
    ... Once you've created the counter script, you now need to cause it to be ... What you are describing is part of a "server-side include". ... The typical way this is done is that you insert code in your HTML file ...
    (comp.infosystems.www.authoring.html)
  • Re: META redirect
    ... I have an SSI script that creates the Web page. ... However, to execute that script, a Web page that refers to it must first be served by the server. ... Instead of generating a complete HTML file and then using Refresh to load that file, why not merely generate the body of the HTML file that contains the SSI include statement. ...
    (comp.infosystems.www.authoring.html)
  • using the email module
    ... second example given in section 7.1.13 of the Python Library Reference ... I see is the HTML rendered in the body of the message, ... Does this give you an email with an HTML file ... Here's the script (put in your own email and server if you want to run ...
    (comp.lang.python)
  • Re: Script Error
    ... var p,i,x; ifd=document; ... No, it doesn't work, and when I changed the case of the function names in the HTML file to match the case in the JS file, the error went away. ... Wasn't sure whether I should change the script to all lower case, ...
    (alt.html)