for /f "tokens=2 delims=:" %%i in ('bootmode C:^|find /i "TotalMemory"') do set tm=%%i
echo 总内存%tm%MB
for /f "tokens=2 delims=:" %%i in ('bootmode C:^|find /i "FreeMemory"') do set fm=%%i
echo 可用内存%fm%MB
for /f "tokens=2 delims=:" %%i in ('bootmode C:^|find /i "UsedMemory"') do set um=%%i
echo 已用内存%um%MB
for /f "tokens=3 delims=:" %%i in ('bootmode C:^|find /i "VolumeLabel"') do set vc=%%i
echo C:盘标签:%vc%
for /f "tokens=3 delims=:" %%i in ('bootmode C:^|find /i "TotalSpace"') do set tc=%%i
echo C:盘总大小%tc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode C:^|find /i "FreeSpace"') do set fc=%%i
echo C:盘可用空间%fc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode C:^|find /i "Usedspace"') do set uc=%%i
echo C:盘已用空间%uc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode C:^|find /i "PartitionType"') do set pc=%%i
echo C:盘分区表类型:%pc%
for /f "tokens=3 delims=:" %%i in ('bootmode D:^|find /i "VolumeLabel"') do set vc=%%i
echo D:盘标签:%vc%
for /f "tokens=3 delims=:" %%i in ('bootmode D:^|find /i "TotalSpace"') do set tc=%%i
echo D:盘总大小%tc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode D:^|find /i "FreeSpace"') do set fc=%%i
echo D:盘可用空间%fc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode D:^|find /i "Usedspace"') do set uc=%%i
echo D:盘已用空间%uc%MB
for /f "tokens=3 delims=:" %%i in ('bootmode D:^|find /i "PartitionType"') do set pc=%%i
echo D:盘分区表类型:%pc%
for /f "tokens=1,8 delims=: " %%i in ('bootmode 1^|find /i "maximum"') do (
set disk=%%i
set FreespaceMAX=%%j)
echo %disk%盘可用空间最大,为%FreespaceMAX%GB
bootmode C:|find /i "BIOS" && goto :BIOS || goto :UEFI
简与不简的区别也不是很大,只是习惯性的有点轻微强迫症。
for /f %%a in ('detectefi32') do set bootdect=%%a
for /f "tokens=3 delims=:" %%i in ('bootmode %drv%:^|find /i "PartitionType"') do set pt=%%i
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=414828
echo 如果是MBR硬盘就重建BIOS引导
for /f "tokens=3 delims=:" %%i in ('bootmode %drv%:^|find /i "PartitionType"') do set pt=%%i
if %pt%==MBR (
if not exist %drv%:\Boot md %drv%:\Boot
copy /y %bcd1% %drv%:\Boot
if not exist %drv%:\bootmgr copy bootmgr8 %drv%:\bootmgr
)