Click here to Skip to main content
15,878,676 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I want to run a bat(exe) file on client machine on button click event by using ASP.net(javascript/ requireJS) without using activeX control.

Regards,
Saad
Posted

1 solution

You can't.
You can do it with ActiveX, but even that doesn't work except in a very few circumstances.

This is deliberate: if you could run a batch file, so could malicious sites. And you can imagine what their batch files would start doing! So for security, Javascript cannot do it.
 
Share this answer
 
Comments
saad.raza 20-Jan-15 11:46am    
Thanks I know that's the issue but I read an article on http://stackoverflow.com/questions/20643470/execute-a-command-line-binary-in-node-js

they are using spawn = require('child_process').spawn; I am unable to do this got some error can you please help me in this regards.
Thanks in Advance :)
glen205 20-Jan-15 11:57am    
Is it possible that node.js is a server-side javascript framework/language - and therefore examples of its usage are in the context of server-side, not client-side execution?

I may have misunderstood as my experience with node.js is only second-hand. My colleague develops using node.js, jade, npm and I get the feeling that whilst your client-side view can have javascript in it (like any html page), the actual "node.js" portion of this concept is server-side execution?
saad.raza 20-Jan-15 12:13pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900