/    Sign up×
Community /Pin to ProfileBookmark

Launch exe from hta

[CODE]
shell = new ActiveXObject(“WScript.shell”);
shell.run(“sketchup.exe”);
[/CODE]

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

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@omnicityOct 05.2010 — Have you tried using the full path?

eg: C:Program Filesblahblah.exe
Copy linkTweet thisAlerts:
@rnd_meOct 05.2010 — any exe in you [I]path [/I]environment variable will work.
Copy linkTweet thisAlerts:
@chrisglasierauthorOct 06.2010 — 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");
[/CODE]


but this doesn't:

[CODE]
shell = new ActiveXObject("WScript.shell");
shell.run("C:/Program%20Files/Google/Google%20SketchUp%207/SketchUp.exe");
[/CODE]


I suppose it is because the hta is a kind of browser but that doesn't explain why winzip and the others work ... [I]or does it?[/I][/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
×

Success!

Help @chrisglasier spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...