How to Reset USB Ports With a Batch File

Save

Resetting a USB port on your computer is can be done by turning off and then turning back a USB port using a batch file. To do this you need to set ACL permissions in the Windows registry. This requires a utility available from Microsoft called SubInACL. Once this file has been installed on your system, you can create the batch files needed to reset a USB port on your computer.

  • Go to the Microsoft Download Center web page for "SubInACL." Click the "Download" button to save the file to your desktop. Double-click the "subinacl.msi" file to install SubInACL on your system

  • Click the "Start" button and type "Notepad" into the search box. Press "Enter" to open the program.

  • Highlight "Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR]

    "Start"=dword:00000004" and right-click to display the context menu. Select the option for "Copy". Click the "Edit" drop down in select the option for "Paste".

  • Click the "File" drop down and select the option for "Save". Save the file as "0.reg" to the "C:" drive.

  • Click the "File" drop down menu and select the option for "New".

  • Highlight "Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR]

    "Start"=dword:00000003"

    and select "Copy" from the context menu. Paste the text into Notepad and save the file as "1.reg" to the "C:" drive.

  • Click the "File" drop down menu and select the option for "New".

  • Highlight "@echo off

    cls

    regedit /s 0.reg

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /deny=system

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /deny=users

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /deny=administrators

    echo.

    echo Disabled

    echo.

    //pause

    " and select "Copy" from the context menu. Paste the text into Notepad and save the file to your "C:" as "Disable.bat"

  • Click the "File" drop down menu and select the option for "New".

  • Highlight "@echo off

    cls

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /grant=system

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /grant=users

    subinacl.exe /keyreg systemcurrentcontrolsetservicesusbstor /grant=administrators

    regedit /s 1.reg

    echo.

    echo Enabled

    echo.

    //pause

    " and select "Copy" from the context menu. Paste the text into Notepad and save the file to your "C:" as "Enable.bat".

  • Double-click the "Disable.bat" file to turn off the USB port. Click the "Enable.bat" file to turn the port back on to complete the reset.

References

Promoted By Zergnet

Comments

Resources

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!