3 Replies - 19187 Views - Last Post: 17 September 2008 - 05:48 PM

#1 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

how to run an application in javascript?

Posted 17 September 2008 - 07:16 AM

hi,when i was logging to aol once,i found that the aol site opened the aim messenger installed on my computer
so how can i do this?how can i run an application from my computer in javascript?
i will use it in a .hta file so i will make a button that will run an application
i can make a button run a function
<input type="button" value="run" onclick="function_name()"/>
or
<input type="button" value=" close " onclick='window.close()'/>
and i am learning more of these things
now i want to know how can i make it run an application as an exe or another file type
any help will be great and i will be thanking alot cuz i have no idea about how to do that beside that i am a begininger in javascript

Is This A Good Question/Topic? 0
  • +

Replies To: how to run an application in javascript?

#2 pemcconnell  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 54
  • View blog
  • Posts: 472
  • Joined: 05-August 08

Re: how to run an application in javascript?

Posted 17 September 2008 - 09:03 AM

javascript is a browser-side language which means that you can access the clients user files. As aim and msn are 99% of the time installed in the same place, it makes opening them far simpler.

i would imagine a simple javascript function would do the job.

This post has been edited by pemcconnell: 18 September 2008 - 03:20 AM

Was This Post Helpful? 0
  • +
  • -

#3 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: how to run an application in javascript?

Posted 17 September 2008 - 03:43 PM

well,i got visual studio2008 from microsoft and when i extracted the iso file,the setup file was a .hta file and when i press an image in it ,it starts the installing from the folder,it was made with css language i think
and if it is possible with CSS language,don't u think it will be possible with javascript?
and if possoble,can someone tell me the code in javascript that can make me press a button and it opens a file using shell if it is called like that in other languages
Was This Post Helpful? 0
  • +
  • -

#4 narmer93  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 317
  • Joined: 13-March 08

Re: how to run an application in javascript?

Posted 17 September 2008 - 05:48 PM

oh,i have just found it
<script Language="JScript">
function runcmd() {
File="cmd.exe";
WSH=new ActiveXObject("WScript.Shell");
WSH.run(File);
}
</SCRIPT> 
<input type="button" value="run" onclick="runcmd()"/>

i had some troubles with it until i found that it needs the locaion to include no spaces in the name,maybe like those _ _
and now it is working well........

This post has been edited by narmer93: 17 September 2008 - 05:54 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1