Re: Path info for VBscript from HTM page

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

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 04/25/04

  • Next message: Alexander Popkov: "Re: Path info for VBscript from HTM page"
    Date: Sun, 25 Apr 2004 13:58:27 -0600
    
    

    "Ko Vijn" <ko@nothere.nnr> wrote in message
    news:c6gq1a$tmt$1@news-reader2.wanadoo.fr...
    > 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.

    If you give only a filename, the system has to make some sort of guess as to
    where to put it. If you want it in a specific location, specify the exact
    path.

    > When I
    > upload the html file to my website and run the script I get an error.

    Likely you do, which of the thousands of possible errors was the one that
    you got? If related to security, it is likely because your browser is (very
    sensibly) not allowing web pages to modify files on your computer. Don't
    change your security settings without understanding what this might mean
    should you happen to browse to a site less friendly than your own.

    > 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.

    Ah, here is the problem, then...

    > 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

    IMHO, if you want a web page to modify a file on the web server, then you
    should really be looking into server side scripting.

    /Al


  • Next message: Alexander Popkov: "Re: Path info for VBscript from HTM page"

    Relevant Pages

    • 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)
    • 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, ...
      (microsoft.public.scripting.vbscript)