public void TestMethod2()
 {
     using (var notepad = new WmiProcess(Environment.SystemDirectory + "\\notepad.exe", "localhost"))
     {
         Thread.Sleep(500);
         notepad.Start();
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WmiOwningProcess"/> class.
 /// </summary>
 /// <param name="startCommand">The start command, typically the exe path (local, not network path) plus any arguments</param>
 /// <param name="hostName">Name of the host.</param>
 /// <param name="disposalAction">The disposal action.</param>
 /// <param name="wmiConnectionOptions">The WMI connection options.</param>
 public WmiOwningProcess(string startCommand, string hostname, Action<IStoppable> disposalAction, ConnectionOptions wmiConnectionOptions = null)
 {
     this.process = new WmiProcess(startCommand, hostname, wmiConnectionOptions);
     this.disposalAction = disposalAction;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WmiOwningProcess"/> class.
 /// </summary>
 /// <param name="startCommand">The start command, typically the exe path (local, not network path) plus any arguments</param>
 /// <param name="hostName">Name of the host.</param>
 /// <param name="disposalAction">The disposal action.</param>
 /// <param name="wmiConnectionOptions">The WMI connection options.</param>
 public WmiOwningProcess(string startCommand, string hostname, Action <IStoppable> disposalAction, ConnectionOptions wmiConnectionOptions = null)
 {
     this.process        = new WmiProcess(startCommand, hostname, wmiConnectionOptions);
     this.disposalAction = disposalAction;
 }