Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. var connection = new ConnectionOptions();
  2. connection.Username = @"xxxx";
  3. connection.Password = "xxxxx";
  4.  
  5.  
  6. ManagementScope WMIscope = new ManagementScope(
  7. string.Format("\\{0}\root\cimv2", REMOTE_COMPUTER_NAME), connection);
  8. WMIscope.Connect();
  9.  
  10. ManagementClass WMIprocess = new ManagementClass(
  11. WMIscope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
  12.  
  13. object[] process = { "cmd.exe" };
  14.  
  15. object result = WMIprocess.InvokeMethod("Create", process);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement