Feedback

2 Feb 2013

Run .exe File on a Webpage

http://t2.gstatic.com/images?q=tbn:ANd9GcTuLsQZlh00rp6-a-kEFehZKgdfethwTm4BkoNbE9p6WVH2vQRNThere are certain scenarios where you need to run your .EXE file through HTML page. In this blog I will show you how can you achieve this task on html page by using JavaScript.
<a href="javascript:LaunchApp()">Click here to Execute your file</a>

The above code will call a user defined function call LaunchApp() which you can see in the following code snippets.
 <script>
function LaunchApp() {
	if (!document.all) {
 
  		alert ("This ActiveXObject is only available for Internet Explorer");
		return; 
	}
	var ws = new ActiveXObject("WScript.Shell");
	ws.Exec("D:\\Software\\youfile.exe");
}
</script>
In the above JavaScript a LaunchApp() is defined which will first check for the browser if your browser is not internet explorer  then it will show you message that your browser doesn’t support the ActiveXObject and only available for InternetExplorer,If it is InternetExplorer then it will create object for WScript.Shell and will execute yourfile.exe in the D:\software location.
 

People

My Photo
We are also on Facebook We are on Twitter Home Page
Hello friends i am Jaskaran SH SD from Amritsar (Punjab) India. I love blogging. First I started a blog on science in 2010. Now I handle only this blog. I like to share the things which I know. I learn many things through blogging. I always try to make different that's why I learn many things. 

About Blog

Construct Internet is one of dedicated source for Internet, Computer and technology tutorials and development. It is Started in Oct 21 2012. We provide a professional tools for websites and blogging, along with a wide range of tutorials, How to fix etc. for computers and other technology development. Social news, Business and Social Science like topics are also followed in our blog.

We 'r Social

2012-2013 Construct Internet. Copying Without Permission is Strictly Prohibited.