- @echo off & setlocal enabledelayedexpansion & set cnt=0
- set all="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
- echo 所有光驱盘符如下:
- for /f "skip=1 delims=:" %%l in ('wmic cdrom get Drive') do (
- (set all=!all:%%l =!)&(set /a cnt+=1)& echo %%l:
- )
- echo 所有磁盘盘符如下:
- for %%d in ("!all!") do if exist %%d:\nul (set /a cnt+=1)& echo %%d:
- echo 共有 !cnt! 个盘
- pause
复制代码
|