Tuesday, January 10, 2012

Programmatically launch Debugger in a remote machine

Flickr Tags: ,

ConnectionOptions options = new ConnectionOptions();
ManagementScope scope = new ManagementScope(\\ComputerAdd\\path\\,
options);
scope.Connect();
ObjectQuery oQuery = new ObjectQuery("Select * from Win32_Process where Name
Like 'ConsoleApp%'"
);
//Execute the query
ManagementObjectSearcher objSearcher =
newManagementObjectSearcher(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

🌫️ Project Title: "Fog Buster – AI-Powered Visibility Enhancement System"

🔍 Project Vision: To design a device that allows vehicles (cars, trucks) and aircraft (planes, helicopters, drones) to see clearly during f...