A lightweight Python tool for enabling and disabling USB devices on Windows.
- Download
ws_usbdisable.exefrom the latest release. - Run the executable. Windows will ask for administrator privileges; accept the UAC prompt.
- The tool checks the current USB mass-storage status and toggles it:
- If USB storage is enabled, it will be disabled.
- If USB storage is disabled, it will be enabled.
- Choose whether to restart Windows immediately. A restart is required for the change to take effect.
Note
This tool only affects USB mass-storage devices such as flash drives and external hard drives. USB keyboards and mice are not disabled.
Building the executable requires Python and PyInstaller:
python -m pip install --upgrade pip
python -m pip install pyinstaller
pyinstaller --onefile --console --name ws_usbdisable ws_usbdisable.py