WebHosting

Saturday, January 14, 2012

Programmatically launch Debugger in a remote machine


ConnectionOptions options = new ConnectionOptions();
 ManagementScope scope = new ManagementScope("\\\\machine1\\root\\cimv2", options);
 scope.Connect();

 ObjectQuery oQuery = new ObjectQuery("Select * from Win32_Process where Name Like 'ConsoleApp%'");
 //Execute the query
 ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(scope,oQuery);

 //Get the results
 ManagementObjectCollection objReturnCollection = objSearcher.Get();

 foreach (ManagementObject oReturn in objReturnCollection)
 {
 if (oReturn["Name"].ToString().Equals("ConsoleApplication1.exe"))
 {
 object outparams = oReturn.InvokeMethod("AttachDebugger", null);
 }
 }

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

เค•िเคธเค•े เคนिเคธ्เคธे เคฎें เคฎें เคฏे เคงเคฐเคคी

เคšिเคก़िเคฏों เค•ा เค˜เคฐ เคœเคฒ เคฐเคนा เคนै  เค‡ंเคธाเคจ เค–ुเคถ เคนै เค•ि เคฏे เค†เค— เคฆूเคฐ เคนै เค…เคญी เค•เคญी เคคो เค†เคเค—ी เค˜เคฐ เคคเค•  เคคेเคฐा เคญी เค˜เคฐ เคœเคฒेเค—ा เค•เคญी เคฌेเคœुเคฌाเคจ เคนै เค•ुเค› เคฌोเคฒเคคे เคจเคนीं เคนै เคฆिเคฒ เคฎें เคฆुเค– ...