SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Launch exe from hta

    Code:
    shell = new ActiveXObject("WScript.shell");
    shell.run("sketchup.exe");
    This snippet works for winzip.exe, iexplore.exe, firefox.exe but not for googleearth, notepad++, sketchup.exe ... I gave up trying to find a link for the cannot find specified file error.

    Can anyone help a newcomer.

    Thanks

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Possibly those programs are not in the path that is being searched when you try to run programs without saying where to look for them.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    I just found out that this works:

    Code:
    shell = new ActiveXObject("WScript.shell");
    shell.run("file:///C:/Program%20Files/Google/Google%20SketchUp%207/SketchUp.exe");
    but this doesn't:

    Code:
    shell = new ActiveXObject("WScript.shell");
    shell.run("C:/Program%20Files/Google/Google%20SketchUp%207/SketchUp.exe");
    I suppose it is because the hta is a kind of browser but that doesn't explain why winzip and the others work ... or does it?


Tags for this Thread

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
  •