我希望当我打开 .bat 文件时显示这个 ASCII 艺术文本,但唯一发生的情况是,当我打开 .bat 文件时它会立即关闭,我知道这是我放置 ASCII 艺术的方式存在问题。
@echo off
echo _______ ______ _______ _______ _______ __ __ ____
echo | || _ | | || || | | | | || |
echo | ___|| | || | _ || _____||_ _| | |_| | | |
echo | |___ | |_||_ | | | || |_____ | | | | | |
echo | ___|| __ || |_| ||_____ | | | | | | |
echo | | | | | || | _____| | | | | | | |
echo |___| |___| |_||_______||_______| |___| |___| |___|
pause
exit
答案1
@echo off
findstr /e "_ |" "%~0" & timeout -1 & exit
_______ ______ _______ _______ _______ __ __ ____
| || _ | | || || | | | | || |
| ___|| | || | _ || _____||_ _| | |_| | | |
| |___ | |_||_ | | | || |_____ | | | | | |
| ___|| __ || |_| ||_____ | | | | | | |
| | | | | || | _____| | | | | | | |
|___| |___| |_||_______||_______| |___| |___| |___|
您还可以删除echo
,并在命令后添加行exit
,并确保以 和 结尾|
(_
行末没有额外的空格),然后过滤感兴趣的行,而无需使用转义^
符