取得硬盘数.bat
程序员文章站
2022-08-26 08:17:14
@echo off cd.>script.txt >>script.txt echo list disk for&...
@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
上一篇: 把程序集安装到全局程序集缓存中的步骤