取得硬盘数.bat
时间:2021-09-01 09:01:37|栏目:DOS/BAT|点击: 次
@echo off
cd.>script.txt
>>script.txt echo list disk
for /f %%i in ('diskpart /s script.txt^|find /c ^"联机^"') do Set HardDrivers=%%i
del script.txt /q
echo 您的计算机上硬盘安装数量为:%HardDrivers%
pause
cd.>script.txt
>>script.txt echo list disk
for /f %%i in ('diskpart /s script.txt^|find /c ^"联机^"') do Set HardDrivers=%%i
del script.txt /q
echo 您的计算机上硬盘安装数量为:%HardDrivers%
pause