Advertisement
Guest User

Untitled

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