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?
@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
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("ASPEx ec.Execute ")
Executor.Application = "C:\WINNT\system32\Calc.ex e"
Executor.Parameters = ""
Executor.ShowWindow = True
Executor.TimeOut = 120
strResult = Executor.ExecuteWinApp
%>
Ok, check this out<br>
</body>
</html>
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("ASPEx
Executor.Application = "C:\WINNT\system32\Calc.ex
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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...
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
No objections from me
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
Vee_Mod
Community Support Moderator
It is too much of a security risk to allow that to happen through code