1

I am trying to run devcon command on windows7 as below but this is stuck forever,if I right-click on "scan for hardware changes" it is stuck aswell,how can I activate a COM port via commandline using devcon?is there a better way?

devcon.exe restart "@USB\VID_05C6&PID_9302&MI_01\6&1E2FC975&0&0001"

enter image description here

Ritz
  • 1,193
  • 6
  • 15
  • 26
  • I would hazard a guess that this represents a bug in the relevant device driver. But why are you trying to restart the driver anyway? That shouldn't be necessary, especially if it is just a COM port. Sounds like an XY problem, what are you actually trying to achieve? – Harry Johnston Oct 16 '16 at 00:03
  • the COM port puts the device is downloadmode,any commands I send to this COM port doesnt work,only after a reboot of the full PC it works,so I am trying to find if there is a way just to restart the driver instead of the whole PC – Ritz Oct 16 '16 at 00:45
  • You shouldn't need to reset the entire driver. Try using the [IOCTL_SERIAL_RESET_DEVICE control code](https://msdn.microsoft.com/en-us/library/windows/hardware/ff546671(v=vs.85).aspx) or perhaps one of the other control codes. See also [Communications Resources](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363196(v=vs.85).aspx), e.g., perhaps all you need to do is to call SetCommState which "reinitializes all hardware and control settings". – Harry Johnston Oct 16 '16 at 01:18
  • ... better still, check the documentation for the device that's attached to the COM port. It should explain how to get the device out of download mode. – Harry Johnston Oct 16 '16 at 01:19
  • How do I send `IOCTL_SERIAL_RESET_DEVICE` request, is there a tool that takes these commmands....JFYI...issue is not about getting the device out of download mode...this COM port supports a variety of operations,it sort of becomes stuck after a while – Ritz Oct 16 '16 at 01:34
  • You would have to write a program to send the I/O control request. But it very much sounds like your problem is a buggy device driver or faulty hardware, so there might not be any way for you to fix this in software. – Harry Johnston Oct 16 '16 at 02:02
  • I dont think its a buggy device driver,it happens on multiple machines ,theres got to be a way to reset the driver without resetting the PC – Ritz Oct 16 '16 at 04:40
  • Well, of course there is. But you're already using it, and it doesn't work. – Harry Johnston Oct 16 '16 at 05:46
  • Have you checked the manufacturer's web site to make sure you're using the latest version of the driver? – Harry Johnston Oct 16 '16 at 05:47

0 Answers0