Reputation: 505
This is a quick question.I just want to know if it is possible to invoke a .exe file on server side by an RPC from client? Thanks.
Upvotes: 0
Views: 4782
Reputation: 60957
Is it possible to invoke an executable on the server side in response to a request from a client? Why yes it is, and there are in fact a myriad ways to do it, each with their own security issues.
The simplest to implement is the Common Gateway Interface (CGI).
But if you want your user (who is on the client end of the connect) to actually interact with the program (e.g. as you would with a desktop application) then you don't want to launch the program on the server side, you want to launch it on the client.
In your comment on Ryan Bates's answer, you say that you're running both the client and server on the same machine. That is an extremely odd configuration. Actually, it sounds like you don't really want to do client/server at all -- instead, you're effectively trying to write a desktop application in JavaScript. If that is the case, perhaps Mozilla XULRunner is more what you're looking for?
Upvotes: 0
Reputation: 28187
It could be possible, yes. But you'd have to make specific provision for it on the server and be very sure that it is secure and only runs when you want it to.
Example (from here):
<html>
<head>
<script type="text/javascript">
function runApp(which) {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run (which,1,true);
}
</script>
</head>
<body>
<font onClick="runApp('file://c:/windows/notepad.exe');" style="cursor:
hand;"><u>Notepad</u>
</font>
<br>
<a href="runApp('file://c:/test.bat');">Batch File</a>
</body>
</html>
Upvotes: 1