Start process on remote machine  
Author Message
susantez





PostPosted: Visual C# General, Start process on remote machine Top

hi all,
How could i start a process on remote machine

thnx...


Visual C#17  
 
 
Ernst Kuschke





PostPosted: Visual C# General, Start process on remote machine Top

Hi,

PsExec [1] (one of the sysinternals tools that Microsoft recently acquired) enables you to do just this, with a very reasonable level of control over how and what happens remotely.

HTH!
1 - http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/PsExec.mspx


 
 
ahmedilyas





PostPosted: Visual C# General, Start process on remote machine Top

you could also use WMI:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=665016&SiteID=1

C# translation:

object theProcessToRun() = { "YourFileHere" };

\\server\root\cimv2:Win32_Process");

theClass.InvokeMethod("Create", theProcessToRun);



 
 
susantez





PostPosted: Visual C# General, Start process on remote machine Top

you could also use WMI:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=665016&SiteID=1

C# translation:

object theProcessToRun() = { "YourFileHere" };

\\server\root\cimv2:Win32_Process");

theClass.InvokeMethod("Create", theProcessToRun);



thnx...

 
 
susantez





PostPosted: Visual C# General, Start process on remote machine Top

object[] theProcessToRun = { "notepad.exe" };
ConnectionOptions theConnection = new ConnectionOptions();
theConnection.Username = "username";
theConnection.Password = "password";
ManagementScope theScope = new ManagementScope("\\\\" + IP + "\\root\\cimv2", theConnection);
ManagementClass theClass = new ManagementClass(theScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
theClass.InvokeMethod("Create", theProcessToRun);