
CODE: [Copy to clipboard]@echo off
set AllDrive=c d e f g h i j k l m n o p q r s t u v w x y z
cd.>%tmp%\MyDrive.txt
for %%a in (%AllDrive%) do (
fsutil fsinfo drivetype %%a: | find /i "Removable Drive">>%tmp%\MyDrive.txt
)
for /f "tokens=1,2,3,4 delims= " %%h in (%tmp%\MyDrive.txt) do (
echo 可移动磁盘的盘符:%%h
)
del %tmp%\MyDrive.txt
CODE: [Copy to clipboard]@echo off
for /f "tokens=2 delims==" %%a in ('wmic LogicalDisk where "DriveType='2'" get * /value ^| findstr /i "^DeviceID"') do echo 可移动磁盘的盘符:%%a
CODE: [Copy to clipboard][ Last edited by zw19750516 on 2008-6-20 at 06:35 PM ]@echo off
for /f "delims=驱动器:\A " %%i in ('fsutil fsinfo drives^|more') do fsutil fsinfo drivetype %%i:|findstr "移动">nul&&call :lp %%i:
if defined flag (
echo 移动磁盘已被免疫。
) else (
echo 未找到可用的移动磁盘。
)
pause>nul&goto :eof
:lp
set flag=A
md %1\autorun.inf
attrib %1\autorun.inf +h +s +a +r
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |