One can run .exe files using JavaScript from a webpage...

function invoke()
{
try
{
var wsh = new ActiveXObject('WScript.Shell');
}
catch (err)
{
}
var count = parseInt(document.getElementById("textpad_count").value);
wsh.Run("C:\notepad.exe");
}


This concept can be used very efficiently when one deals with opening lot of .exe files for their work frequently. for example: My friend need to open 10 putty clients to connect to a server and 10 text pads simultaneously. This concept helped me a lot.

I used wsh.Run("C:\putty -ssh host -l username -pw password"); in place of wsh.Run("C:\notepad.exe");

Note: host, username and password should be filled with actual vales.

Comments (0)