Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote executable 1

Status
Not open for further replies.

nybz

Programmer
Mar 18, 2004
19
0
0
US
I there a way to have a servlet fire an executable on a remote box? I want the user to push a "go" button on an html form which comes to the servlet - which in turn initiates a job on a remote machine (such as cmd.exe). If this is possible, please help me with the key points - mainly, getting the command from the servlet to the remote box.
 
The OS is Windows 2000. The idea is to provide an admin with a Web browser an HTML page where they have a link that
accesses a servlet (remotely). The servlets job would be to open a CMD.exe on the server (machine) itself with some parameter - like running a batch file. Hence, running the command remotely via HTML.
 
You realise that if this machine is accessible on a WAN (ie internet) then this is a MAJOR security risk.

Anyway, if you want to run a command from Java :

String cmd = "dir";
Process p = Runtime.getRuntime().exec("cmd /c " +cmd);
p.waitFor();

--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks sedj - you rock. Acknowledged about the risk...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top