Avatar of wonder lust
wonder lust
 asked on

Enable/Disable a specific USB port with a batch file or similiar?

As topic says - I'm looking for a way to disable a very specific usb port when I'm running the batch file, or any other method. It just has to be a file that enables / disables the usb port.
Also I'm using win7

thanks in advance!
Windows BatchOperating Systems

Avatar of undefined
Last Comment
Lee Ingalls

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Lee Ingalls

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
wonder lust

ASKER
Hey, devcon looks good so far, although i have one issue. How do i identify the device i'm trying to enable/disable? aka how do i know which one is which out of all these?
Lee Ingalls

I interpreted your original question as you knew which specific USB port.
Will it be different each time?

You can look at the Registry to see USB usage history
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR
wonder lust

ASKER
Also i found the device in device manager

edit: it's the same usb port every time i want to shut off - just havnt found it yet
edit2: looked through the registry in the directory u typed but i only found disks and cd drive information?
edit3: found the usb history in "USB" though - still not sure how to identify since most of the information for the usb is the same as the others (drivers, dates etc). Only thing that is different is the location "Location 0 (Port_#0004.Hub_#0001)".
edit9972: Found the location information, although a lot of them has that same location, which one is the right one?
Your help has saved me hundreds of hours of internet surfing.
fblack61
wonder lust

ASKER
i think i found the id finally, but how do i type it exactly? to test i'm trying this: "devcon.exe find 5&3b0d2cff&0&4" is this correct?
wonder lust

ASKER
bumpelibump
wonder lust

ASKER
help plx

i found how to enable/disable devices, also i found the hardware id and everything works except one huge issue, there are several devices with same hardware id.. what do i do?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Lee Ingalls

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.