Invoking a process on the remote machine

  • Thread starter Thread starter Nidhee Pathak via .NET 247
  • Start date Start date
N

Nidhee Pathak via .NET 247

Hi,

I am trying to run an exe present on the remote machine using the ManagementClass object. I connect to the remote machine using ObjectManagementScope class, but i am not being able to run the exe through normal Win32 process. How should I go about it?
 
Nidhee,

You can not just run a program of your choosing on a remote machine.
You need to have some sort of environment to run it in. Basically, the only
way you are going to be able to run a program on the machine is if you have
another program already running on the machine (which has a login), that
will run the program on the machine for you.

Basically, you should create a service (or a serviced component which
can be called to) which exposes an object which will take the name of the
program that you want to run and then run it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Nidhee Pathak via .NET 247 said:
Hi,

I am trying to run an exe present on the remote machine using the
ManagementClass object. I connect to the remote machine using
ObjectManagementScope class, but i am not being able to run the exe through
normal Win32 process. How should I go about it?
 
What kind of program are you trying to run remotely, does it have a UI or
not?

Willy.
 
Nicholas ,

OP mentioned ManagementClass, that is, he's using WMI under the covers, so
this should work unless he's trying to run a windows UI application or an
application that needs a specific security context to run in.

Willy.

Nicholas Paldino said:
Nidhee,

You can not just run a program of your choosing on a remote machine.
You need to have some sort of environment to run it in. Basically, the
only
way you are going to be able to run a program on the machine is if you
have
another program already running on the machine (which has a login), that
will run the program on the machine for you.

Basically, you should create a service (or a serviced component which
can be called to) which exposes an object which will take the name of the
program that you want to run and then run it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Nidhee Pathak via .NET 247 said:
Hi,

I am trying to run an exe present on the remote machine using the
ManagementClass object. I connect to the remote machine using
ObjectManagementScope class, but i am not being able to run the exe
through
normal Win32 process. How should I go about it?
 
Back
Top