- @echo off & setlocal enabledelayedexpansion
- set index=0
- for /f "eol= skip=1 delims=" %%i in ('wmic path Win32_PhysicalMedia get SerialNumber') do (
- set/a index+=1
- set disk!index!_sn=%%i
- )
- echo 磁盘数量:%index%
- for /l %%i in (0, 1, %index%) do if %%i lss %index% (echo 磁盘%%i序列号:!disk%%i_sn!)
- pause
复制代码 总是多一个空白的 |