本帖最后由 ai20110304 于 2018-9-15 23:44 编辑
- @echo off
- ::硬盘
-
- for /f "skip=2" %%i in ('wmic logicaldisk where drivetype^=3 get name') do set /a DiskCnt+=1
- ::移动盘
- for /f "skip=2" %%i in ('wmic logicaldisk where drivetype^=2 get name') do set /a RemCnt+=1
-
- echo;磁盘 %DiskCnt% 个
- echo;移动磁盘 %RemCnt% 个
- set DiskCnt=
- set RemCnt=
-
- pause>nul
复制代码
|