@echo off &color 1e &setlocal enabledelayedexpansion
pushd "%~dp0"
for /f "tokens=1-3,*" %%i in ('echo list disk^|diskpart^|findstr /n .^|findstr "B"') do (
set a=%%k
set /a a=!a!+1
set a=!a!
)
for /f "tokens=1-3,*" %%i in ('echo list vol^|diskpart^|findstr /n .^|findstr "B"') do (
set b=%%k
set /a b=!b!+1
set b=!b!
)
echo 磁盘数: %a% 分区数: %b%
pause
exit