中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-27 15:04
47,820 topics / 349,938 posts / today 0 new / 48,298 members
DOS批处理 & 脚本技术(批处理室) » [Share] Disabling & Enabling USB Devices Is So Simple (Classifiable by Standards)
Printable Version  8,983 / 35
Floor31 thispjj Posted 2009-06-16 04:12
新手上路 Posts 1 Credits 2
@echo off
set Reg_Path=HKLM\SYSTEM\CurrentControlSet\Enum\USB
for /f "delims=*" %%a in ('reg query "%Reg_Path%"^|find /i "Vid_"') do (
for /f "skip=4 delims=" %%b in ('reg query "%%a"') do (
for /f "skip=4 tokens=3" %%i in ('reg query "%%b" /v CompatibleIDs') do (
for /f "skip=4 tokens=1,2,*" %%a in ('reg query "%%b" /v DeviceDesc') do (
for /f "delims=&" %%j in ("%%i") do (
echo %%j Device Name: %%c
)
)
)
)
)
echo.&echo To query USB\Class_XX subcategories, change the "delims=&" of the 5th for to "delims="
pause
Floor32 lijinan Posted 2010-04-01 13:13
初级用户 Posts 12 Credits 33
Thanks, it's good.
Floor33 guo882633 Posted 2010-04-02 10:40
初级用户 Posts 53 Credits 126 From -
@echo off
start mode con cols=1 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

:min
for /f %%i in ('devcon findall usb* ^|find /i "usb mass storage"') do devcon remove "@%%i"
exit
Floor34 moonbeam Posted 2010-04-08 11:50
新手上路 Posts 4 Credits 5
Great, learned something, thanks.
Floor35 xxpp Posted 2010-04-12 12:00
新手上路 Posts 3 Credits 3
Floor36 bida Posted 2010-06-03 18:09
新手上路 Posts 1 Credits 1
So simple to disable USB devices originally, learned it
Prev  1 2 3
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023