Faraz Shah Khan

MCP, MCAD.Net, MCSD.Net, MCTS-Win, MCTS-Web, MCPD-Web

Javascript to open application on client's machine

Long time back I was wondering if some how I will be able to open any application through my website on client's machine. Finally I came to know that yes it is possible and I will end up with this code.

Following code will open up notepad on client's machine. Before opening the file it will prompt the user, if the user accepts then it will opened. As of now it worked on windows with explorer only.

<script> 
     function go()
    {
         
w = new ActiveXObject("WScript.Shell");
         
w.run('notepad.exe');
         
return true;
    } 
</script>


<form>
          Run Notepad (Window with explorer only)
         
<input type="button" value="Go" onClick="return go()">
</form>

Comments

Mojtaabaa said:

what credential does it need?is it always enabled?

what about security notifications?

# April 29, 2008 4:22 AM

roshan said:

hello,

your code creates a task on client machine but than i have to manually go there and tick the "Run only if logged on" check box to actually run it..

is there a way to do this ticking programatically??? please help.....

# May 23, 2008 5:24 AM

knurly said:

Great! Now I'll continue my search to find a way to open link files (.txt) with notepad

# May 25, 2009 6:35 PM

Ejaz said:

Can it be used to open any other application like adobe or some other application? I am trying to open one of the Software tool through this and it is not working.

The exact address of the .exe file is Program Files/tools/mmt.exe and it is not working.

Any idea how can we make it work?

Its working fine for notepad and cmd line.

# October 14, 2009 8:33 PM

Mahuya Nargis said:

I am trying to prepare a JAVASCRIPT to run any .exe from remote server using any browser(like IE, FF,Chrome). My script is working fine in IE.

So, do have any idea how to prepare a single JAVASCRIPT to execute any .exe from remote server using any browser?

# July 11, 2011 3:45 AM

Rudolf said:

look at

forums.mozillazine.org/viewtopic.php

one of the last entries.

# August 17, 2011 2:59 PM

WebStarter webzen si o no? - P?gina 2 said:

Pingback from  WebStarter webzen si o no? - P?gina 2

# October 10, 2011 10:38 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)