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!

Recommended Answers

All 2 Replies

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.

php it is, thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.