Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.01 KB

File metadata and controls

25 lines (18 loc) · 1.01 KB

python-usbdisable

A lightweight Python tool for enabling and disabling USB devices on Windows.

How to use

  1. Download ws_usbdisable.exe from the latest release.
  2. Run the executable. Windows will ask for administrator privileges; accept the UAC prompt.
  3. 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.
  4. 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.

Requirements and build

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