Results 1 to 3 of 3

Thread: Launch an application in Javascript

  1. #1
    Join Date
    Mar 2010
    Location
    Canada
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Launch an application in Javascript

    If I want to launch an application in DOS, it is START notepad.exe

    How do I launch an application in javascript?


    thanks

  2. #2
    Join Date
    Mar 2010
    Location
    Canada
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I'm only using this on my local host and not on the internet. I tried something like this, it works for notepad or calc.
    Code:
    var WshShell = new ActiveXObject("WScript.Shell");
    WshShell.Exec("notepad.exe");
    It does not work if I launch a non built in MS application.
    Code:
    var WshShell = new ActiveXObject("WScript.Shell");
    WshShell.Exec("d:\hjsplit.exe");

    Any comments or suggestions is greatly

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's (highlighted) a string and the \ is the escape character, so:

    Code:
    WshShell.Exec("d:\hjsplit.exe");
    looks like:

    Code:
    WshShell.Exec("d:hjsplit.exe");
    to the browser. Just escape the escape:

    Code:
    var WshShell = new ActiveXObject("WScript.Shell");
    WshShell.Exec("d:\\hjsplit.exe");
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •