返回列表 发帖

[特效代码] VT.bat 批处理控制台虚拟终端序列库:让您的批处理更多彩

本帖最后由 HOPE2021 于 2025-2-23 09:43 编辑

早在两年前,我就曾在论坛中推广使用控制台虚拟终端序列(http://www.bathome.net/thread-63749-1-1.htmlhttp://www.bathome.net/thread-65044-1-1.html),奈何其门槛高,可读性差,最终没有被广泛应用,也导致了我放下批处理。最近重回论坛,看到一好帖(http://www.bathome.net/thread-70576-1-1.html),便又想起曾经的愿望,于是花费几个小时,完成了批处理控制台虚拟终端序列库以及示例的编写工作,使得使用控制台虚拟终端序列的编程难度得以降低。希望各位能够喜欢本代码库,并能够应用在自己的批处理中。

代码和示例请见二、三楼。

为什么要使用控制台虚拟终端序列?

  • 对于实用程序,可以使得输出更有层次,方便用户阅读所输出的信息
  • 对于特效和游戏,使用控制台虚拟终端序列可以获得更多色彩,实现复杂的画面效果
  • 相比于早期用 FindStr 输出,速度更快,无临时文件,可输出效果更多


如何使用该库?
导入
Call VT.batCOPY
使用函数和常数
方法类似于http://www.bathome.net/thread-5861-1-1.html
变量名以“VT.”起始的,是常数和独立函数。变量名以“VTInline.”起始的,是内联函数。
使用示例:
%= 独立函数 =%
%VT.TextCursor.EnableModeHide%
%= 内联函数 =%
Echo;%VTInline.Cursor.SaveCursorPosition%
%= 带参数的独立函数 =%
%VT.Cursor.Position:#y#;#x#=10;3%
%= 带参数的内联函数 =%
Echo; %VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%#COPY
示例截图
1

评分人数

Why join the navy, if you can be a pirate? - Steve Jobs

本帖最后由 HOPE2021 于 2025-2-22 22:39 编辑

库代码,请保存为VT.bat
%= VT.bat 批处理控制台虚拟终端序列库 =%
%= 请使用 GB2312 编码保存 =%
%= 参考:learn.microsoft.com/zh-cn/windows/console/console-virtual-terminal-sequences =%
%================================================================%
%= 初始化 ESC 字符和基本引导序列 =%
%================================================================%
@For /F "Delims=#" %%_ in ('Prompt #$E# ^& Echo on ^& For %%$ in ^(1^) Do DosKey') Do @Set "VT.ESC=%%_"
@Set VT.CSI=%VT.ESC%[
%================================================================%
%= 标准颜色 =%
%================================================================%
@Set VT.Colors.Black=0
@Set VT.Colors.Red=1
@Set VT.Colors.Green=2
@Set VT.Colors.Yellow=3
@Set VT.Colors.Blue=4
@Set VT.Colors.Magenta=5
@Set VT.Colors.Cyan=6
@Set VT.Colors.White=7
@Set VT.Colors.Default=9
%================================================================%
%= 简单光标定位 =%
%================================================================%
@Set VTInline.Cursor.ReverseIndex=%VT.ESC%M
@Set VTInline.RI=%VTInline.Cursor.ReverseIndex%
@Set VTInline.Cursor.SaveCursorPosition=%VT.ESC%7
@Set VTInline.DECSC=%VTInline.Cursor.SaveCursorPosition%
@Set VTInline.Cursor.RestoreCursorPosition=%VT.ESC%8
@Set VTInline.DECSR=%VTInline.Cursor.RestoreCursorPosition%
%================================================================%
%= 光标定位 =%
%================================================================%
@Set VTInline.Cursor.Up=%VT.CSI%#n#A
@Set VTInline.CUU=%VTInline.Cursor.Up%
@Set VTInline.Cursor.Down=%VT.CSI%#n#B
@Set VTInline.CUD=%VTInline.Cursor.Down%
@Set VTInline.Cursor.Forward=%VT.CSI%#n#C
@Set VTInline.CUF=%VTInline.Cursor.Forward%
@Set VTInline.Cursor.Backward=%VT.CSI%#n#D
@Set VTInline.CUB=%VTInline.Cursor.Backward%
@Set VTInline.Cursor.NextLine=%VT.CSI%#n#E
@Set VTInline.CNL=%VTInline.Cursor.NextLine%
@Set VTInline.Cursor.PreviousLine=%VT.CSI%#n#F
@Set VTInline.CPL=%VTInline.Cursor.PreviousLine%
@Set VTInline.Cursor.HorizontalAbsolute=%VT.CSI%#n#G
@Set VTInline.CHA=%VTInline.Cursor.HorizontalAbsolute%
@Set VTInline.VerticalLinePositionAbsolute=%VT.CSI%#n#d
@Set VTInline.VPA=%VTInline.VerticalLinePositionAbsolute%
@Set VTInline.Cursor.Position=%VT.CSI%#y#;#x#H
@Set VTInline.CUP=%VTInline.Cursor.Position%
@Set VTInline.Cursor.HorizontalVerticalPosition=%VT.CSI%#y#;#x#f
@Set VTInline.HVP=%VTInline.Cursor.HorizontalVerticalPosition%
@Set VTInline.Cursor.SaveCursorAnsiSysEmulation=%VT.CSI%s
@Set VTInline.ANSISYSSC=%VTInline.Cursor.SaveCursorAnsiSysEmulation%
@Set VTInline.Cursor.RestoreCursorAnsiSysEmulation=%VT.CSI%u
@Set VTInline.ANSISYSRC=%VTInline.Cursor.RestoreCursorAnsiSysEmulation%
%================================================================%
%= 光标可见性 =%
%================================================================%
@Set VTInline.TextCursor.EnableBlinking=%VT.CSI%?12h
@Set VTInline.TextCursor.DisableBlinking=%VT.CSI%?12l
@Set VTInline.TextCursor.EnableModeShow=%VT.CSI%?25h
@Set VTInline.TextCursor.EnableModeHide=%VT.CSI%?25l
%================================================================%
%= 光标形状 =%
%================================================================%
@Set VTInline.TextCursor.UserShape=%VT.CSI%0 q
@Set VTInline.TextCursor.BlinkingBlock=%VT.CSI%1 q
@Set VTInline.TextCursor.SteadyBlock=%VT.CSI%2 q
@Set VTInline.TextCursor.BlinkingUnderline=%VT.CSI%3 q
@Set VTInline.TextCursor.SteadyUnderline=%VT.CSI%4 q
@Set VTInline.TextCursor.BlinkingBar=%VT.CSI%5 q
@Set VTInline.TextCursor.SteadyBar=%VT.CSI%6 q
%================================================================%
%= 视区定位 =%
%================================================================%
@Set VTInline.Viewport.ScrollUp=%VT.CSI%#n#S
@Set VTInline.SU=%VTInline.Viewport.ScrollUp%
@Set VTInline.Viewport.ScrollDown=%VT.CSI%#n#T
@Set VTInline.SD=%VTInline.Viewport.ScrollDown%
%================================================================%
%= 文本修改 =%
%================================================================%
@Set VTInline.Text.InsertCharacter=%VT.CSI%#n#@
@Set VTInline.ICH=%VTInline.Text.InsertCharacter%
@Set VTInline.Text.DeleteCharacter=%VT.CSI%#n#P
@Set VTInline.DCH=%VTInline.Text.DeleteCharacter%
@Set VTInline.Text.EraseCharacter=%VT.CSI%#n#X
@Set VTInline.ECH=%VTInline.Text.EraseCharacter%
@Set VTInline.Text.InsertLine=%VT.CSI%#n#L
@Set VTInline.IL=%VTInline.Text.InsertLine%
@Set VTInline.Text.DeleteLine=%VT.CSI%#n#M
@Set VTInline.DL=%VTInline.Text.DeleteLine%
@Set VTInline.Text.EraseInDisplay=%VT.CSI%#n#J
@Set VTInline.ED=%VTInline.Text.EraseInDisplay%
@Set VTInline.Text.EraseInLine=%VT.CSI%#n#K
@Set VTInline.EL=%VTInline.Text.EraseInLine%
%================================================================%
%= 文本格式 =%
%================================================================%
@Set VTInline.Formatting.SetGraphicsRendition=%VT.CSI%#n#m
@Set VTInline.SGR=%VTInline.Formatting.SetGraphicsRendition%
@Set VTInline.Formatting.Default=%VTInline.SGR:#n#=0%
@Set VTInline.Formatting.BoldOrBright=%VTInline.SGR:#n#=1%
@Set VTInline.Formatting.NoBoldOrBright=%VTInline.SGR:#n#=22%
@Set VTInline.Formatting.Underline=%VTInline.SGR:#n#=4%
@Set VTInline.Formatting.NoUnderline=%VTInline.SGR:#n#=24%
@Set VTInline.Formatting.Negative=%VTInline.SGR:#n#=7%
@Set VTInline.Formatting.NoNegative=%VTInline.SGR:#n#=27%
@Set VTInline.Formatting.Positive=%VTInline.SGR:#n#=7%
@Set VTInline.Formatting.Foreground=%VTInline.SGR:#n#=3#n#%
@Set VTInline.Formatting.Background=%VTInline.SGR:#n#=4#n#%
@Set VTInline.Formatting.BrightForeground=%VTInline.SGR:#n#=9#n#%
@Set VTInline.Formatting.BrightBackground=%VTInline.SGR:#n#=10#n#%
@Set VTInline.Formatting.ForegroundRGB=%VTInline.SGR:#n#=38;2;#r#;#g#;#b#%
@Set VTInline.Formatting.BackgroundRGB=%VTInline.SGR:#n#=48;2;#r#;#g#;#b#%
@Set VTInline.Formatting.Foreground256=%VTInline.SGR:#n#=38;5;#s#%
@Set VTInline.Formatting.Background256=%VTInline.SGR:#n#=48;5;#s#%
@Set VTInline.Formatting.Foreground88=%VTInline.SGR:#n#=38;5;#s#%
@Set VTInline.Formatting.Background88=%VTInline.SGR:#n#=48;5;#s#%
%================================================================%
%= 屏幕颜色(索引):由于行为似乎不能被 CMD 实现,所以不支持 =%
%================================================================%
%================================================================%
%= 模式更改:由于行为似乎不能被 CMD 实现,所以不支持 =%
%================================================================%
%================================================================%
%= 查询状态:由于行为似乎不能被 CMD 完全实现,所以不支持 =%
%================================================================%
%================================================================%
%= 制表符 =%
%================================================================%
@Set VTInline.Tabs.HorizontalTabSet=%VT.ESC%H
@Set VTInline.Tabs.HTS=%VTInline.Tabs.HorizontalTabSet%
@Set VTInline.Tabs.CursorHorizontalForwardTab=%VT.CSI%#n#I
@Set VTInline.CHT=%VTInline.Tabs.CursorHorizontalForwardTab%
@Set VTInline.Tabs.CursorBackwardsTab=%VT.CSI%#n#Z
@Set VTInline.CBT=%VTInline.Tabs.CursorBackwardsTab%
@Set VTInline.Tabs.TabClearCurrentColumn=%VT.CSI%0g
@Set VTInline.Tabs.TabClearAllColumns=%VT.CSI%3g
%================================================================%
%= 指定字符集 =%
%================================================================%
@Set VTInline.CharacterSet.DEC=%VT.ESC%(0
@Set VTInline.CharacterSet.ASCII=%VT.ESC%(B
%================================================================%
%= 滚动边距 =%
%================================================================%
@Set VTInline.SetScrollingRegion=%VT.CSI%#t#;#b#r
@Set VTInline.DECSTBM=%VTInline.SetScrollingRegion%
%================================================================%
%= 窗口标题:由于有 Title 命令,没有必要实现 =%
%================================================================%
%================================================================%
%= 备用屏幕缓冲区 =%
%================================================================%
@Set VTInline.Buffers.UseAlternateScreenBuffer=%VT.CSI%?1049h
@Set VTInline.Buffers.UseMainScreenBuffer=%VT.CSI%?1049l
%================================================================%
%= 窗口宽度:由于行为似乎不能被 CMD 实现,所以不支持 =%
%================================================================%
%================================================================%
%= 软重置 =%
%================================================================%
@Set VTInline.SoftReset=%VT.CSI%!p
@Set VTInline.DECSTR=%VTInline.SoftReset%
%================================================================%
%= 输入序列:由于行为似乎不能被 CMD 实现,所以不支持 =%
%================================================================%
%================================================================%
%= 生成命令版函数 =%
%================================================================%
@For /F "delims=. tokens=1,*" %%I in ('@Set VTInline') Do @(
    @For /F "delims== tokens=1,*" %%i in ('Echo;%%J') Do @(
        @Set "VT.%%i=@Set /P="%%j"< Nul"
    )
)
%================================================================%
%= 软重置 =%
%================================================================%
%VT.SoftReset%COPY
Why join the navy, if you can be a pirate? - Steve Jobs

TOP

示例代码:
@Echo Off & Color 1F & Chcp 936 > Nul & Title 批处理控制台虚拟终端序列库测试 & Mode Con: Cols=80 Lines=25
If "%*"=="" (
Start ConHost "%~0" CONHOST
Exit /B 0
)
%= 初始化批处理控制台虚拟终端序列库 =%
Echo;正在初始化批处理控制台虚拟终端序列库……
Call VT.bat
SetLocal EnableExtensions EnableDelayedExpansion
:Main
%VT.TextCursor.EnableModeHide%
%VT.Formatting.Background:#n#=!VT.Colors.White!%
%VT.Cursor.Position:#y#;#x#=1;1%
%VT.Text.EraseCharacter:#n#=80%
   
Echo; %VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%#^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!% F%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%文件^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!% E%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%编辑^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   S%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%搜索^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   R%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%运行^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   C%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%编译^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   D%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%调试^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   P%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%项目^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   O%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%选项^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   W%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%窗口^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%   H%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!%帮助
%VT.Cursor.Position:#y#;#x#=25;1%
%VT.Text.EraseCharacter:#n#=80%
Set /P=%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!% F1%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 帮助^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%  F2%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 保存^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%  F3%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 打开^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%  Alt-F9%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 编译^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%  F9%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 生成^
%VTInline.Formatting.Foreground:#n#=!VT.Colors.Red!%  F10%VTInline.Formatting.Foreground:#n#=!VT.Colors.Black!% 菜单< Nul
%VT.Formatting.Background:#n#=!VT.Colors.Blue!%
%VT.Formatting.BrightForeground:#n#=!VT.Colors.White!%
Call :Rect 2 2 78 16
%VT.Cursor.Position:#y#;#x#=18;1%
%VT.CharacterSet.DEC%
For /L %%i in (0,1,36) Do Set /P=q< Nul
%VT.Cursor.Forward:#n#=1%
Set /P=信息< Nul
%VT.Cursor.Forward:#n#=1%
For /L %%i in (0,1,36) Do Set /P=q< Nul
%VT.CharacterSet.ASCII%
%VT.Cursor.Position:#y#;#x#=3;3%
Echo;批处理是一门简单的脚本语言,虽然不能独当一面,但是,若作为工作中的辅助工具,
%VT.Cursor.Position:#y#;#x#=4;3%
Echo;绝对会让大家有随用随写、称心如意的畅快感。
%VT.Cursor.Position:#y#;#x#=5;3%
Echo;和其他语言相比,批处理语言有其先天性的优势:
%VT.Cursor.Position:#y#;#x#=7;3%
Echo;1、系统自带,无需另行安装;
%VT.Cursor.Position:#y#;#x#=8;3%
Echo;2、命令少,语句简洁,上手非常快;
%VT.Cursor.Position:#y#;#x#=9;3%
Echo;3、编写出来的脚本小巧玲珑,随写随用;
%VT.Cursor.Position:#y#;#x#=10;3%
Echo;……
%VT.Formatting.BackgroundRGB:#r#;#g#;#b#=250;250;250%
%VT.Cursor.Position:#y#;#x#=12;3%
Echo;%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=204;204;204%1%VTInline.CharacterSet.DEC%x%VTInline.CharacterSet.ASCII%^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%@%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=197;132;1%echo %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%off^
%VTInline.Text.EraseCharacter:#n#=65%
%VT.Cursor.Position:#y#;#x#=13;3%
Echo;%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=204;204;204%2%VTInline.CharacterSet.DEC%x%VTInline.CharacterSet.ASCII%^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=197;132;1%set %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%str=c d e f g h i j k l m n o p q r s t u v w x y z^
%VTInline.Text.EraseCharacter:#n#=19%
%VT.Cursor.Position:#y#;#x#=14;3%
Echo;%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=204;204;204%3%VTInline.CharacterSet.DEC%x%VTInline.CharacterSet.ASCII%^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=197;132;1%echo %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%当前硬盘的分区有:^
%VTInline.Text.EraseCharacter:#n#=51%
%VT.Cursor.Position:#y#;#x#=15;3%
Echo;%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=204;204;204%4%VTInline.CharacterSet.DEC%x%VTInline.CharacterSet.ASCII%^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=166;38;164%for %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=152;104;1%%%%%i ^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=166;38;164%in %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%(%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=152;104;1%%%str%%%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%) ^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=166;38;164%do if exist %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=152;104;1%%%%%i%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=56;58;66%: ^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=197;132;1%echo %VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=152;104;1%%%%%i: ^
%VTInline.Text.EraseCharacter:#n#=28%
%VT.Cursor.Position:#y#;#x#=16;3%
Echo;%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=204;204;204%5%VTInline.CharacterSet.DEC%x%VTInline.CharacterSet.ASCII%^
%VTInline.Formatting.ForegroundRGB:#r#;#g#;#b#=197;132;1%pause^
%VTInline.Text.EraseCharacter:#n#=69%
%VT.SetScrollingRegion:#t#;#b#=19;24%
%VT.TextCursor.EnableModeShow%
%VT.TextCursor.BlinkingBlock%
%VT.Cursor.Position:#y#;#x#=19;1%
%VT.Formatting.Background:#n#=!VT.Colors.Blue!%
%VT.Formatting.BrightForeground:#n#=!VT.Colors.White!%
For /L %%i in (0,0,1) Do (
Echo;当Windows为我们打开了五彩缤纷的图形窗口的时候
TimeOut /T 1 > Nul
Echo;DOS命中注定会陨落
TimeOut /T 1 > Nul
Echo;CMD毫无悬念将萎缩
TimeOut /T 1 > Nul
Echo;批处理逐渐趋向无声无息
TimeOut /T 1 > Nul
Echo;而powershell的到来,无疑会让更多的人忘记批处理
TimeOut /T 1 > Nul
Echo;这是一门即将失传的技艺
TimeOut /T 1 > Nul
Echo;这是一块行将就木的领域
TimeOut /T 1 > Nul
Echo;然而,命令行工具仍然具有批量处理一切的巨大威力
TimeOut /T 1 > Nul
Echo;字符界面仍然是高效操作的代名词
TimeOut /T 1 > Nul
Echo;曾为批处理的方便灵活而击节赞赏
TimeOut /T 1 > Nul
Echo;曾被批处理的简洁快速深深折服
TimeOut /T 1 > Nul
Echo;一直以来,总想为批处理的推广做些什么
TimeOut /T 1 > Nul
Echo;……
TimeOut /T 1 > Nul
Echo;只是,年年岁岁花相似,岁岁年年人不同
Echo;…………
TimeOut /T 1 > Nul
Echo;
TimeOut /T 1 > Nul
Echo;
TimeOut /T 1 > Nul
)
Pause > Nul
Goto :Main
:Rect <X> <Y> <Width> <Height>
SetLocal EnableExtensions EnableDelayedExpansion
Set /A"X=%1"
Set /A"Y=%2"
Set /A"Width=%3"
Set /A"Height=%4"
Set /A"Right=%X%+%Width%-1"
Set /A"Bottom=%Y%+%Height%-1"
%VT.CharacterSet.DEC%
%VT.Cursor.Position:#y#;#x#=!Y!;!X!%
%VT.Cursor.Forward:#n#=1%
For /L %%i in (3,1,%Width%) Do (
Set /P=q< Nul
)
%VT.Cursor.Position:#y#;#x#=!Bottom!;!X!%
%VT.Cursor.Forward:#n#=1%
For /L %%i in (3,1,%Width%) Do (
Set /P=q< Nul
)
%VT.Cursor.Position:#y#;#x#=!Y!;!X!%
%VT.Cursor.Down:#n#=1%
For /L %%i in (3,1,%Height%) Do (
Set /P=x< Nul
%VT.Cursor.Backward:#n#=1%
%VT.Cursor.Down:#n#=1%
)
%VT.Cursor.Position:#y#;#x#=!Y!;!Right!%
%VT.Cursor.Down:#n#=1%
For /L %%i in (3,1,%Height%) Do (
Set /P=x< Nul
%VT.Cursor.Backward:#n#=1%
%VT.Cursor.Down:#n#=1%
)
%VT.Cursor.Position:#y#;#x#=!Y!;!X!%
Set /P=l< Nul
%VT.Cursor.Position:#y#;#x#=!Y!;!Right!%
Set /P=k< Nul
%VT.Cursor.Position:#y#;#x#=!Bottom!;!X!%
Set /P=m< Nul
%VT.Cursor.Position:#y#;#x#=!Bottom!;!Right!%
Set /P=j< Nul
%VT.CharacterSet.ASCII%
EndLocal
Goto :EofCOPY
Why join the navy, if you can be a pirate? - Steve Jobs

TOP

谢谢楼主分享强帖,我要学习一下

我经常在批处理中使用的是 字符颜色,清除指定行的内容,光标移动,过渡色进度条 等等

TOP

返回列表