Executing Programs Using Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob V

    Executing Programs Using Javascript

    I was wondering whether there was any way of loading an executable or
    windows shortcut from within a browser using Javascript or something
    similar.

    This is for use in an active desktop html file which will only ever be
    used on my personal computer.

    Any ideas?
  • kaeli

    #2
    Re: Executing Programs Using Javascript

    In article <47d5fd53.03091 51004.10ff8d84@ posting.google. com>,
    valentine_rob@h otmail.com enlightened us with...[color=blue]
    > I was wondering whether there was any way of loading an executable or
    > windows shortcut from within a browser using Javascript or something
    > similar.
    >
    > This is for use in an active desktop html file which will only ever be
    > used on my personal computer.
    >
    > Any ideas?
    >[/color]

    Use WSH with JScript/VBScript.

    Long links ahead...


    q=jscript+run+e xe+active+deskt op&hl=en&lr=&ie =UTF-8&oe=UTF-8&selm=%
    23Pn3FsLF%23GA. 209%40uppssnews pub05.moswest.m sn.net&rnum=5


    q=jscript+run+e xe+active+deskt op&hl=en&lr=&ie =UTF-8&oe=UTF-8
    &selm=OsUMlbI6% 23GA.248%40cpps sbbsa05&rnum=1



    -------------------------------------------------
    ~kaeli~
    Hey, if you got it flaunt it! If you don't, stare
    at someone who does. Just don't lick the TV screen,
    it leaves streaks.


    -------------------------------------------------

    Comment

    • Rob V

      #3
      Re: Executing Programs Using Javascript

      I have tried this previousely and it works up to a point. But if you
      try and run certain things, games mainly using this method you get
      problems.

      As far as i can work out this is because the game that you are trying
      to run thinks its home directory is where the HTML page is rather than
      where the game is and therefore can't find its config files etc.

      Games that do this on my machine are Morrowind, Quake3 and a few
      others. Some games don't have this problem at all probably as they
      use the registry for storing all the info.

      Anyone have any ideas how to get around this?

      Comment

      • GIMME

        #4
        Re: Executing Programs Using Javascript

        You guys haven't been c.l.j much lately have you?

        <HTML>
        <HEAD>
        <TITLE>Run SQL*PLUS</TITLE>
        <SCRIPT language=javasc ript>

        function linkit(filename )
        {
        strpagestart = "<HTML><HEA D></HEAD><BODY><OBJ ECT CLASSID=" +
        "'CLSID:1000000 0-0000-0000-0000-000000000000' CODEBASE='";
        strpageend = "'></OBJECT></BODY></HTML>";
        runnerwin.docum ent.open();
        runnerwin.docum ent.write(strpa gestart + filename + strpageend);
        window.status = "Done.";
        return false; // stop hyperlink and stay on this page
        }
        </script>
        </HEAD>
        <BODY>
        <!-- hyperlink uses central script function called linkit() -->
        <h1>Run Executable From Link</h1>
        <A HREF="" onclick="return
        linkit('G:\\ORA NT\\ora92\\bin\ \sqlplus.exe'); ">SQL*PLUS</A><br>
        <!-- hidden iframe used for inserting html content -->
        <IFRAME ID=runnerwin WIDTH=0 HEIGHT=0 SRC="about:blan k"></IFRAME><BR/>
        </BODY>
        </HTML>

        Comment

        • Rob V

          #5
          Re: Executing Programs Using Javascript

          Thanks for the reply but still having the same problem with running
          games this way. Explained in earlier post.

          Any other ideas?

          Comment

          • Grant Wagner

            #6
            Re: Executing Programs Using Javascript

            GIMME wrote:
            [color=blue]
            > You guys haven't been c.l.j much lately have you?
            >
            > <HTML>
            > <HEAD>
            > <TITLE>Run SQL*PLUS</TITLE>
            > <SCRIPT language=javasc ript>
            >
            > function linkit(filename )
            > {
            > strpagestart = "<HTML><HEA D></HEAD><BODY><OBJ ECT CLASSID=" +
            > "'CLSID:1000000 0-0000-0000-0000-000000000000' CODEBASE='";
            > strpageend = "'></OBJECT></BODY></HTML>";
            > runnerwin.docum ent.open();
            > runnerwin.docum ent.write(strpa gestart + filename + strpageend);
            > window.status = "Done.";
            > return false; // stop hyperlink and stay on this page
            > }
            > </script>
            > </HEAD>
            > <BODY>
            > <!-- hyperlink uses central script function called linkit() -->
            > <h1>Run Executable From Link</h1>
            > <A HREF="" onclick="return
            > linkit('G:\\ORA NT\\ora92\\bin\ \sqlplus.exe'); ">SQL*PLUS</A><br>
            > <!-- hidden iframe used for inserting html content -->
            > <IFRAME ID=runnerwin WIDTH=0 HEIGHT=0 SRC="about:blan k"></IFRAME><BR/>
            > </BODY>
            > </HTML>[/color]

            Doesn't do anything here, IE6SP1 Q822925.

            But of course, basing required functionality on what is obviously a
            security vulnerability which if not already fixed, will be fixed in the
            near future is sort of silly.

            --
            | Grant Wagner <gwagner@agrico reunited.com>

            * Client-side Javascript and Netscape 4 DOM Reference available at:
            *


            * Internet Explorer DOM Reference available at:
            *
            Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


            * Netscape 6/7 DOM Reference available at:
            * http://www.mozilla.org/docs/dom/domref/
            * Tips for upgrading JavaScript for Netscape 7 / Mozilla
            * http://www.mozilla.org/docs/web-deve...upgrade_2.html


            Comment

            Working...