Help - Search - Members - Calendar
Full Version: open txt files and call batch files using html
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
sharagi
Is it possible to open a txt file from html link...

<html>
<body>

<a href=""file://C:/Blast/input.txt">inputPage</a>

<a href=""file://C:/Blast/up.bat">click</a>

</body>
</html>


is the above thing correct I could not see any result
pandy
Count the quotes. There's one too many.

A text file is no problem. I doubt you can run a bat file. Possibly with IE and a HTA, but I'm not very familiar with that.
sharagi
QUOTE(pandy @ Apr 3 2009, 02:33 PM) *

Count the quotes. There's one too many.

A text file is no problem. I doubt you can run a bat file. Possibly with IE and a HTA, but I'm not very familiar with that.



I am able to open the txt file but I need to edit them...is it possible to open an input.txt and paste some thing in it..and save it...
Darin McGrew
You need to configure your browser to open text files in a text editor, rather than in a browser window.

And of course, you'll be able to save it to the original location only if that location is on a filesystem (either your local filesystem, or a networked filesystem).
sharagi
QUOTE(Darin McGrew @ Apr 3 2009, 03:08 PM) *

You need to configure your browser to open text files in a text editor, rather than in a browser window.

And of course, you'll be able to save it to the original location only if that location is on a filesystem (either your local filesystem, or a networked filesystem).



how should I configure....can u tell me...
Darin McGrew
In my copy of Opera, it would be
Tools > Preferences... > Advanced > Downloads > Add...

Then I'd enter the MIME type (text/plain) and File extensions (txt) and configure it to open with the application I wanted. I'm not sure about other browsers.
richard.williams
You may need a script to automate. One below is in biterscripting ( http://www.biterscripting.com/install.html ) . It will automatically open all local files referred/linked on a web page one by one.

CODE
var str page; cat "http://something..." > $page
var str links; script SS_URLs.txt URL($page) > $links
# Do one link at a time. Is it a local text file ?
while ($links <> "")
do
    var str link; lex "1" $links > $link
    # Is there a file:// in this ? If so, it is a local file.
    if ( { sen -c "^file://^" $link }  > 0 )
    do
        # Edit this file.
        var str file; stex -c "^file://^[" $link > $file
        system edit ("\""+$file+"\"")
    done
    endif
done


Make sure you install all sample scripts from the installation instructions, because the script SS_URLs.txt we are using above is a sample script. Email me if you need help.

Richard
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.