I want to disable/enable all usb ports at once.
I tried the following:
Changed the registry (with admin privileges):
//disable USB storage...
Micros
make USBSTOR value to 4 and restart the PC. Another way is to disable in BIOS. Most of the computer manufacturers support this. But it will disable not only storage but all.
That registry key prevents the USBSTOR driver from loading. It won't unload it if it is already in use. So you will not see any effect until after reboot.