0

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!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by crackerjacker
0

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.

Edited by pritaeas: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.