Web Hosting Talk







View Full Version : How to execute program in remote server?


muramasa
08-22-2007, 10:31 AM
In my code I am executing a program that resides on another server. But when I execute the program the server where the code is resided runs the program and sucks up CPU.

How can I make it execute the program in the remote server? I don't want it to just fetch the exe and run it locally. I want it to execute the program in the remote server. The remote server is a network share, \\server2 for example.

Any thoughts?

juangake
08-22-2007, 03:29 PM
What about thinking what happens when you hit a script on the remote server using your browser?
Say... http://myremoteserver.com/myscript.php

That script can write/read a file at the server where it's located, right?

So why not calling that script from your local server? Open an http connection and make the hit from your local server (from your home computer that would simply be hitting that script from your browser...)

If that isn't enough, then please give more detail (from what language are you executing that remote program?)

muramasa
08-23-2007, 07:06 AM
The remote server does not serve files over http. It is not a web server.

Steve_Arm
08-23-2007, 07:08 AM
I think only Remote Desktop would execute the software on the server, at least in Windows.

foogee
08-23-2007, 11:59 AM
If you want to do it manually, then remote desktop connection would work, or the cross-platform VNC http://www.realvnc.com/ .

If you want to do it without human intervention, it is more tricky. My approach would be to write a Windows Service with an open tcpip port that will accept commands to run programs and then run the programs. (Sorry for the confused expllaination).

Can you give more details of your application?

Jatinder
08-23-2007, 02:32 PM
Take a look at this: http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/PsExec.mspx

psexec used to be a part of the sysinternals.com group of tools but now seems to have been taken over by Microsoft.


Also, Java has something called RMI (Remote Method Invocation). It allows you to call methods on remote objects just as if they were on the local machine. Its been some years since I last coded in Java, so I can't help you any further with RMI. Maybe someone else can provide more details.

muramasa
08-24-2007, 05:24 AM
Thanks! Psexec is what i need.