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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question

Status
Not open for further replies.

FALCONSEYE

Programmer
Jul 30, 2004
1,158
US
is it possible to execute a file on a remote server? i have all the rights. all i want to do is to execute a file and pass the arguments something like
e:/gpg.exe is the file to run

gpg -e -r XXX test22.txt

perhaps any classes/methods i should be aware of?
thanks for the help in advance


 
I'd bet for System.exec() to start. Search this fourm, sedj has answered this question with an useful code snippet a lot of times.

Cheers,
Dian
 
If your machine can see the executable (ie you have the remote filesystem mounted/exported etc) then you can use a simple :

Process p = Runtime.getRuntime().exec(command_to_execute);
p.waitFor();

If you cannot see the filesystem, then you will need to use some kind of technology like RMI to remotely execute the file.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top