Article View: comp.lang.javascript
Article #229Re: Can I execute another application?
From: Ken Bigelow
Date: Thu, 24 Oct 1996 00:00
Date: Thu, 24 Oct 1996 00:00
76 lines
3252 bytes
3252 bytes
Eddie Shave wrote: > > In article <3263a2f9.11279589@news.demon.co.uk> David A. Agbamu wrote: > > On Mon, 14 Oct 1996 10:07:41 +0100 Eddie Shave > > <eshave@edlyn.demon.co.uk> wrote: > > > > >I'm using win3.1/Netscape3.0 > > >Can I call a dos program using the javascript OnClick() event. ? > > >This program will create and save a html document, then terminate. > Control > > >should then return to the JavaScript. > > >Alternatively is there a way to create and save the document using java > > >alone? > > > > This is half an answer. > > 1)You need Batsh 220 > > ftp://ftp.demon.co.uk/pub/mirrors/simtel/win3/batch/batsh220.zip > > (It may have changed version numbers since I downloaded it) > > > > 2) Associate the extension *.bsh with Batsh220 > > > > A batsh file is very similar to a batch file, but will run under > > Windows. Create a batsh file dosprog.bsh: > > > > dosprog.exe > > > > 3) In Netscape set Batsh220 as the helper app for *.bsh files > > > > 4) You can then create a URL to dosprog.bsh > > > > <A HREF="dosprog.bsh">dosprog</A> > > > > or <A HREF="file:///C|/dosprog/dosprog.bsh">dosprog</A> > > > > where C:\dosprog\dosprog.bsh is the path to dosprog.bsh > > > > which should run when the URL is clicked on. > > > > Let me know if it works. > > > > > > David > > -- > > David A. Agbamu, Manchester, UK. > > The Absolute Beginner's Guide to creating a Demon Homepage > > http://www.agbamu.demon.co.uk/ABG/ABG.html > > > > Works fine... :) > > Thanks to all who replied. > I can believe it worked if you installed batsh or a similar utility on your own computer. But don't depend on it being on any other client's computer, and don't expect Javascript to access it correctly in that manner. I am repeatedly amazed at the number of questions on how to get around the security precautions very carefully built into Netscape's handling of Javascript. By deliberate intent, Javascript cannot read or write files on your computer; if it could, be sure there would be lots of very unpleasant viruses out there by now, and no doubt some erased hard drives as well. Remember: if your page can write an innocuous file to someone else's hard drive, another page can write a deadly one to yours. Let's *please!* consider the possible consequences before we try anything like this! -- Ken Are you interested in | byte-sized education | http://www.play-hookey.com over the Internet? |
Technical Details
Message-ID:
<326FD57A.4EBA@www.play-hookey.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<Magpie845312861eshave@edlyn.demon.co.uk> <3263a2f9.11279589@news.demon.co.uk> <Magpie845567699eshave@edlyn.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f76f2,46a29a8f232b67a8 X-Google-Attributes: gidf76f2,public X-Google-Thread: fb3cb,46a29a8f232b67a8 X-Google-Attributes: gidfb3cb,public From: Ken Bigelow <kbigelow@www.play-hookey.com> Subject: Re: Can I execute another application? Date: 1996/10/24 Message-ID: <326FD57A.4EBA@www.play-hookey.com> X-Deja-AN: 191852528 references: <Magpie845312861eshave@edlyn.demon.co.uk> <3263a2f9.11279589@news.demon.co.uk> <Magpie845567699eshave@edlyn.demon.co.uk> content-type: text/plain; charset=us-ascii organization: Erol's Internet Services mime-version: 1.0 reply-to: kbigelow@www.play-hookey.com newsgroups: comp.lang.javascript,demon.homepages.authoring x-mailer: Mozilla 3.0 (Win16; U)