0

I am looking for a way to execute my exe in a remote pc (Win2003) from another Admin Server (Win2003) and collect the output generated by that exe.

My app.exe (for eg) will execute and write information to a text file. I also want to read this text file (this is in remote server) from a Admin Server.

I know the path of the exe in the remote system and also know the text file path which will be generated. But i dont know how to execute the app.exe from a remote server using VC++/C++.

Looking for help.

Thanks Raghu

neoraghav
  • 13
  • 4

3 Answers3

0

You should create some service on the target machine ( a WCF service for example ) hosted on IIS or preferable in a window service, ensure that service have all the permission needed to run the executable, then shell it and collect the standard output as shown for example here. from the remote machine then you can call the service and it's done.

Community
  • 1
  • 1
Felice Pollano
  • 32,832
  • 9
  • 75
  • 115
0

I'm not sure, but maybe WinRM (Windows Remote Management) will be useful for your purpose. You can read an introduction here.

"Windows Remote Management" on msdn.microsoft.com.

As to me, I was working with this technology a few years ago. But I was using C# instead of C++ (don't worry, link I provided is about C++ API). Thereat I implemented a remote RS232 (comport) handling. WinRM allows you to do many cool things (for another example, you can control a process on a remote computer).

Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58
0

If the application (executable) is already installed on the remote machine(s), you can use WMI to spawn process on the remote machine.

Use Win32_Process and execute Create method.

JohnCz
  • 1,613
  • 1
  • 9
  • 9