In order to make the typesetting beautiful, you need to display several lines of characters with inconsistent lengths in a fixed length. How to achieve it?
The code is as follows:
[ Last edited by willsort on 2006-5-22 at 00:33 ]
The code is as follows:
@echo off
cls
color 2e
title Disk partition remaining space situation
echo.
echo.
echo ╔══════════════════════════════╗
echo ║ Disk partition Remaining space (MB) ║
echo ║ _____________________________________________________ ║
setlocal enabledelayedexpansion
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\nul (
for /f "tokens=3" %%b in ('dir /-c %%a:\^|find "Available bytes"') do (set freesize=%%b
set /a freesize=!freesize:~0,-3!/1049>nul 2>nul
echo ║ %%a: !freesize! ║
)
)
)
echo ╚══════════════════════════════╝
pause>nul
[ Last edited by willsort on 2006-5-22 at 00:33 ]

