Click to See Complete Forum and Search --> : launching an app w/ javascript?


geuis
04-15-2003, 06:32 AM
I am trying to create an html file that, when run, works to setup a lot of tools I use throughout the day here at my job. I am wondering if its possible, using javascript, to have it open another application, such as netscape. Any help is appreciated.

Geuis

geuis
04-15-2003, 07:21 AM
An update to this: I did more searching and I guess that javascript cannot do this. Is it possible to have javascript launch a batch file? If so, I can create a simple batch file to open Netscape.

viravan
04-15-2003, 08:06 AM
Some Java methods and classes are exposed in Netscape 4.7+, you can try the following statements in your script and see if it works:


netscape.security.PrivilegeManager.enablePrivilege("UniversalExecAccess");
Runtime.getRuntime().exec(callAndArgs);


Where callAndArgs is a string reprsenting the command to execute and the optional arguments required by the command.

This trick will definitely not work in IE or NN6/7 (since NN6/7 no longer has a built-in JVM).

:)

V.V.