0

Where i can get the instance id of Com_port? I tried in device manager but those are not working

string instance_Path = @"VID_12D1&PID_140C&MI_02";
DeviceHelper.SetDeviceEnabled(mouseGuid, instance_Path, true);
Roman R.
  • 68,205
  • 6
  • 94
  • 158
user3459969
  • 11
  • 1
  • 2

1 Answers1

1

This question is virtually a duplicate - Win32 API function to programmatically enable/disable device

"mouseGuid" might be pasted from there. I suppose you're specifying a wrong GUID for the COM port. You can see the correct one in the Device Manager, Details tab -> choose "Class Guid" from the dropdown menu.

Having troubles messing with WinAPI, you can use a library (e.g. Hardware Helper) or an external tool (DevCon).

Community
  • 1
  • 1
enkryptor
  • 1,574
  • 1
  • 17
  • 27