DOS变量的命令

来源:百度知道 编辑:UC知道 时间:2024/09/22 05:19:18
--------------------------------
@echo off
title 英语字典
echo 请输入你要的查看的单词
Set /p aum=在这里输入单词:
If /I "%aum%"=="love" goto love
:love
echo 中文意思:love
-----------------------------------
在这个批处理里面,,,,假如我没有加入love的解释,能不能让
它跳转到
-------------------------
:erro
对不起没有你要查找的单词
------------------------
但是有N多的单词没有加入
我总不能都给他们添加跳转命令吧?
有没有那个变量可以表示我没有的单词????

在所有if后加入erro行就可以啊,如果不符合所有条件就会运行erro了

@echo off
:start
cls
title 英语字典
echo 请输入你要的查看的单词
Set /p aum=在这里输入单词:
If /I "%aum%"=="" goto :erro
If /I "%aum%"=="love" goto love
If /I "%aum%"=="lover" goto lover
If /I "%aum%"=="loop" goto loop
If /I "%aum%"=="lolo" goto lolo
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx
If /I "%aum%"=="xxxx" goto xxxx<