1

We have an awful USB FTDI device (COM port) that usually requires us to disconnect and reconnect the USB cable to get the thing to work properly after a PC reboot. Sometimes it doesn't give us trouble, but more often than not it does. Unfortunately we are stuck with the device due to project momentum.

At this point, I'm willing to find a work-around just to save us that extra step every day.

Is there any way to programmatically disconnect and reconnect this USB FTDI cable? Be it a batch file, .NET application, Power-shell, etc? Something I could add as an auto-run startup program.

1 Answers1

1

Quick Steps for Disabling/Enabling Hardware Devices Using Powershell`` (Run in **Administartor mode !)

In this example, I will be disabling the Killer Networks E2400 Network Controller. Step 1: Confirm the device is present and enabled

Get-PnpDevice -FriendlyName "*ftdi*"  // HERE YOU HAVE TO USE A PART OF THE NAME AS SEEN IN DEVICE_MANAGER

A status of OK indicates the device is enabled. The class, friendly name, and truncated InstanceId is also displayed. Confirm the device is present and enabled using get-pnpdeviceConfirm the device is present and enabled using get-pnpdevice

Step 2: Find the InstanceID of the device

Get-PnpDevice -FriendlyName "*ftdi*" | ft -wrap -autosize friendlyname, instanceid

This command returns the friendlyname and instanceid without truncating the values. Use get-pnpdevice to find the instanceidUse get-pnpdevice to find the instanceid Step 3: Disable the device using the InstanceID found in step 2

Disable-PnpDevice -InstanceId "PCI\VEN_XXXX&DEV_XXXX&SUBSYS_E000XXXX&REV_10\4&325XXXX&0&00XX -confirm:$false

Copy the full InstanceId found in step 1 into the disable cmdlet. use disable-pnp to disable the device using powershelluse disable-pnp to disable the device using powershell Step 4: Check your work using Get-PnpDevice

Get-PnpDevice -FriendlyName "*ftdi*"

A status of ‘Error’ indicates that the device is not enabled. You can also check manually with the device manager. get-pnpdevice shows the device is disabledget-pnpdevice shows the device is disabled

You can now re-enable the device by using enable-pnpdevice -instanceid as follows:

Enable-PnpDevice -InstanceId "PCI\VEN_XXXX&DEV_XXXX&SUBSYS_E000XXXX&REV_10\4&325XXXX&0&00XX" -confirm:$false

You can then confirm it is enabled by using get-pnpdevice one more time. A status of ‘OK’ indicates that it is enabled.

Get-PnpDevice -FriendlyName "*ftdi*"

If that works pack into a script and you are good to go