Skip to content

Instantly share code, notes, and snippets.

@Thecarisma
Created December 28, 2019 22:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thecarisma/b96d8cb6518a176c64b3a9d82d52ab67 to your computer and use it in GitHub Desktop.
Save Thecarisma/b96d8cb6518a176c64b3a9d82d52ab67 to your computer and use it in GitHub Desktop.
Use brute-force method to enable a device when disabled by device control programs (e.g anti-virus). This simple script can be used to activate a disk drive even if a device control program is up.
@echo off
REM download the microsoft devcon app https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon
REM Download x64 if your arch is x64 same for x32
REM change this 'USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0' to your device instace path
REM Run as Administrator
:exec
devcon enable @"USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0"
goto:exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment