www.webdeveloper.com
Results 1 to 4 of 4

Thread: Launch exe from hta

  1. #1

    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
    Join Date
    Jan 2005
    Posts
    350
    Have you tried using the full path?
    eg: C:\Program Files\blah\blah.exe

  3. #3
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    any exe in you path environment variable will work.

  4. #4
    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?[/QUOTE]

    But anyway now I need a way for a user to select an exe file so it can be stored in the application. If anyone can help with that I would be most grateful.

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles