[已解決]批處理獲取磁盤數(shù)量信息為啥對不上呢總是多一個空白的nclick="copycode($('code0'));">復(fù)制代碼
- @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 磁盤數(shù)量:%index%
- for /l %%i in (0, 1, %index%) do if %%i lss %index% (echo 磁盤%%i序列號:!disk%%i_sn!)
- pause