run .exe server side
hi-
currently i have a small (LAN only) web server running on my computer, and i would like to be able to make a web page in which i can run a program on the server computer from another compuer. say, for instance, i click a button on the web page running on the server, i want that action to run a .exe on the server. i came up with this code, but it doesn't run it server side, it runs it on the computer with the browser.
<HEAD>
<TITLE>Run Executable HTA</TITLE>
</HEAD>
<body bgcolor=#565656>
<script language="javascript" type="text/javascript">
function runtest()
{
var oShell = new ActiveXObject("WScript.Shell");
var prog = "C:\\teset.exe";
oShell.run ('"'+prog+'"',1);
}
</script>
<input type="button" onclick="runtest()" value="test">
</BODY>
any ideas? Thanks!
crackerjacker
Junior Poster in Training
53 posts since Sep 2008
Reputation Points: 8
Solved Threads: 3
That is because javascript is a client side language. If you use for example php on your server, you can use exec() to run something serverside. ( http://php.net/exec ). Every server script/language has a way to do it.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
crackerjacker
Junior Poster in Training
53 posts since Sep 2008
Reputation Points: 8
Solved Threads: 3