Board logo

标题: 求助!如何让两个批命令的结果并列显示!! [打印本页]

作者: bhghgh     时间: 2007-9-30 20:46    标题: 求助!如何让两个批命令的结果并列显示!!

批命令如下:
@echo off

setlocal enabledelayedexpansion

:Main
cls
set /a num2=800*600
for %%i 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 (
    set driver=%%i
    set num1=0
    set num3_str=
    set num4=
    for /f "tokens=3" %%j in ('dir /a /-c %%i:\ 2^>nul') do set num1=%%j
    if not "!num1!"=="0" (
        call :loop
        for /f "delims=0 tokens=*" %%k in ("!num3_str!") do set num3_str=%%k
        if not defined num3_str (
            echo.&echo        %%i 盘尚未被使用,具体空间无法查询&echo.
        ) else (
            echo.&echo        %%i 盘剩余空间为 !num3_str! MB&echo.
        )
    )
)
goto bak

:loop
:: 求商
set /a num3=%num4%%num1:~0,1%/%num2%
:: 求商序列
set num3_str=%num3_str%%num3%
:: 求余
set /a num4=%num4%%num1:~0,1%%%%num2%
if %num4% equ 0 set num4=
set num1=%num1:~1%
if not "%num1%"=="" goto loop
goto :eof

:bak
for /f "skip=1 tokens=1,2" %%i in ('"wmic logicaldisk get Caption,FileSystem"') do echo %%i %%j

Echo.
echo 建立不能删除bak备份文件夹
echo 选择盘符
Echo.
Echo [d盘]
Echo [e盘]
Echo [f盘]
Echo [g盘]
Echo [h盘]  
Set Choice=
Echo.
Set /P Choice= 请输入要执行的盘符,然后按回车:
Echo.
If '%Choice%'=='' goto other
If /I '%Choice%'=='d' GOTO d
If /I '%Choice%'=='e' GOTO e
If /I '%Choice%'=='f' GOTO f
If /I '%Choice%'=='g' GOTO g
If /I '%Choice%'=='h' GOTO h
Goto menu1
:d
md d:\bak..\
XCOPY GhostExp.exe d:\bak~1
XCOPY Ghost.exe d:\bak~1
attr +h d:\bak~1
Echo.
Echo d:\bak. OK
pause>nul
goto end
:e
md e:\bak..\
XCOPY GhostExp.exe e:\bak~1
XCOPY Ghost.exe e:\bak~1
attr +h e:\bak~1
Echo.
Echo e:\bak. OK
pause>nul
goto end
:f
md f:\bak..\
XCOPY GhostExp.exe f:\bak~1
XCOPY Ghost.exe f:\bak~1
attr +h f:\bak~1
Echo.
Echo f:\bak. OK
pause>nul
goto end
:g
md g:\bak..\
XCOPY GhostExp.exe g:\bak~1
XCOPY Ghost.exe g:\bak~1
attr +h g:\bak~1
Echo.
Echo g:\bak. OK
pause>nul
goto end
:h
md h:\bak..\
XCOPY GhostExp.exe h:\bak~1
XCOPY Ghost.exe h:\bak~1
attr +h h:\bak~1
Echo.
Echo h:\bak. OK
pause>nul
goto end

怎么让输出的结果并列显示。格式如下:

c:fat32  c盘剩余空间~M

求达人指点迷津!!
作者: lxmxn     时间: 2007-9-30 21:33
set/p=something <nul
echo --anotherthing