Real Red.
Real Red.

Reputation: 5039

How to invoke a remote program in Java?

Is it possible to invoke an exe on a remote computer, supposing we know the absolute path of the exe where it lies?

I have written a client and a server program and am able to get both work as expected when both are running. But now, all I want to do is to invoke the server program from client if server is not running. Seems like defeating the purpose of server-client model but still.

If that is possible without knowing the login credentials of the remote system, then it'd be cool. Eg: There are softwares like 'PsExec' that need login credentials.

I understand that, such a feature may not be there, as it would mean a serious security threat, but, I am just wondering if there is some sort of a workaround.

Upvotes: 1

Views: 1140

Answers (4)

Philippe Carriere
Philippe Carriere

Reputation: 3720

The only way you can execute an exe is by executing a local application which you have access to. There must be a part of the software running on the computer you want to execute an application on. From there, you can do a remote call from a second program on a remote machine asking the local one to do his job : execute.

As stephen C said, it would be a violent breach of security if I could run exe on your machine without your permision.

Upvotes: 0

Dylan McClung
Dylan McClung

Reputation: 89

You could setup a messaging system like a remote procedure call, webservice, or simple tcp socket on the server to do a wake up on the server process.

Upvotes: 0

Stephen C
Stephen C

Reputation: 718778

If that is possible without knowing the login credentials of the remote system, then it'd be cool. Eg: There are softwares like 'PsExec' that need login credentials.

I understand that, such a feature may not be there, as it would mean a serious security threat, but, I am just wondering if there is some sort of a workaround.

Those "inconvenient" security rules are there for a purpose. You simply do not want people to be able to run any old program on your machine without proper authentication and authorization. Not even if you are behind a firewall.

Why?

In one word - Viruses! If some machine on your network gets infected with a virus (or similar malware), then all machines that run a non-authenticated remote execute service would be at serious risk of infection.

Upvotes: 2

vehomzzz
vehomzzz

Reputation: 44578

Try Gridserver technologies... it's based on grid technology and very efficient and easily deployable.

Upvotes: 0

Related Questions