Link to home
Start Free TrialLog in
Avatar of arichexe
arichexe

asked on

Remote Command

How would I run a remote command (i.e., C:\MyModule.exe) on another Win2K3 server from an ASP page?
Avatar of kevp75
kevp75
Flag of United States of America image

you wouldn't.

It is too much of a security risk to allow that to happen through code
@arichexe

I agree with @kevp75, but its not completely impossible but i would not suggest anything as to how to go about it.

I would rather suggest you have the copy of your EXE on the server and RUN it as below...

Set WshShell = Wscript.CreateObject ("Wscript.Shell")
WshShell.Run "http://servername/path/executablefile.exe", 1, false
Also if you use ASPExec and try the below code then you should be able to RUN it behind(at the backdrop of windows) nothing would be visible i guess...You will need ASPExec DLL.

You will get the same on http://www.serverobjects.com/products.htm

Then register the dll.


<% Response.CacheControl = "no-cache" %>>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
<html>
<head>
  <title>Run exe file</title>
</head>
<body>
<%
Dim Executor
Dim strResult
    Set Executor = Server.CreateObject("ASPExec.Execute")
    Executor.Application = "C:\WINNT\system32\Calc.exe"
   
    Executor.Parameters = ""
    Executor.ShowWindow = True
    Executor.TimeOut = 120
    strResult = Executor.ExecuteWinApp
%>
Ok, check this out<br>
</body>
</html>
If you don't get the ASPExec DLL on the site specified then search the web you should be able to get it.
ASKER CERTIFIED SOLUTION
Avatar of arichexe
arichexe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
not to make myself out to be a pessimist but, I really hope this is on an intranet that you are using this....and not a public site.

It's not difficult to download a page and get your username and password, and wreck havok on the machine(network) this will be running on....


just my 2c...
;)

No objections from me
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator