问题描述
有关批处理文件的另一个问题
Another question about batch files
我知道作品(也choice.com),但在一次回香港专业教育学院如何选择见过选项菜单中,将让你选择之间切换
i know how choice works (also choice.com) but once in the back ive seen an option menu that would let you to toggle between options
样的东西[ON]关闭
和切换时上的东西[关闭]
反之亦然
我知道2种方式。
which 1 way is to write both conditions and display the one needed ..
and the other is to toggle "[ ]" signs ...
我不能做第二个方法,需要一些帮助。。
还我一直在寻找运动的文章,但他们似乎并不有任何事情来帮助
i cant do the 2nd way and need some help..also ive been looking at movement articles but they do not seem to have anything to help
THX读取通道,并有一个愉快的一天:)
thx for reading the passage and have a nice day :)
推荐答案
有可能是几十个的方式来做到这一点。这里有一个简单的办法,很可能不是最优雅的,但它的工作原理:
There are probably dozens of ways to accomplish this. Here is one simple way, likely not the most elegant but it works:
@echo off
set _on=0
:top
cls
if %_on%==0 (set _nlb= &set _nrb= &set _flb=[&set _frb=]) else (set _nlb=[&set _nrb=]&set _flb= &set _frb= )
echo The '_on' flag is currently: %_nlb% On %_nrb% %_flb% Off %_frb%
echo.
echo Press any key to toggle the '_on' flag
pause>nul
if %_on%==0 (set _on=1) else (set _on=0)
goto top
这篇关于[批量/ .bat文件]切换帮助一些选项菜单/切换,能够菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!