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

How to run exe file in local computer?

Status
Not open for further replies.

transurban1

Technical User
Jan 27, 2005
5
0
0
US
Hi guys.

I developed server-client architecture using winsocket class in visual basic .net 2005.
I have one server and four clients that have its own exe file coded by visual basic .net as well.
So, what I want to do is that when I run server side script, I want to control the client side computers together. That is, server side computer has to run client side exe files. However, I tried several ways but it didn't give what I want.

Would you help me out please?

Thank you very much.
 
If you just need to execute the exe files then 2005 has a Process.Start() overload that should allow you to start a process on a remote pc.

Alternatively, you can use the PsTools from Microsoft.


To start an exe on a remote pc using the PsTools you would create a Process object, set the exe path property (for PsExec on the host server) and set the arguments property (so that PsExec knows what to do) and then start the process.

If you actually need to "control" the remote applications after they have been started, then you may have some work left to do.


Senior Software Developer
 
Thank you.

I studied process.start method, but what I really want to is different.
Les's there are two computers (computer A and computer B).
Each computer has exe file coded with Visual Basic .Net.
I am doing something with computer A, and sometime later I have to access computer B and run exe file in computer B.
That is, computers are physically separated, and one computer wants to control the other computer via visual basic .net.
Is this possible thing?

Thank you for your help in advance.

Sincerely,
 
Does the exe on Computer B need to be attended by a user, or can it just be started and let run all by itself?

Process.Start can't by itself start a process on another pc, but it can start the PsExec tool in PsTools wich can start your remotely hosted process.

I know this is a messed up chain of events, but if Computer B's exe can run completely unattended and exits once it is complete THEN you can start it from .NET running on Computer A.

This is how:
Dim a New Process Object
Set the Process path to the PsExec.exe file located on computer A.
Set the Process Arguments for PsExec.exe
(including ComputerB's UserName, Password, Path to exe you want to run, any arguments for exe you want to run if needed, computerB's Name... etc)
Use Process.Start Method to kick it off.

If everything it right, that should start your exe on Computer B.

>> Alternatively, you could write a windows service that runs on computer B that starts your exe... OR if ComputerB has IIS you could write a simple web service to start it.

Senior Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top