关于批处理文件和代码的确认

时间:2015-11-14 14:55:58

标签: windows batch-file cmd

我正在编写批处理文件。我正在使用这个命令;

set /p cmd="Enter Command here = "
if "%cmd%"=="Help" goto Help
if "%cmd%"=="Exit" goto Exit

但我真的不知道这些代码

意思是,我想知道我是否可以删除" " "%cmd%"或者如果我使用像这样的命令

if "%cmd%"=="install apple itunes" goto itunes

批处理文件崩溃但我使用时 if "%cmd%"=="install apple.itunes" goto itunes,即苹果itunes没有空格它很好 SomeOne可以告诉我这些代码以及如何使用if "%cmd%"=="install apple itunes",即使用Spaces。

1 个答案:

答案 0 :(得分:0)

不,您无法从" "移除"%cmd%"。如果用户输入"安装apple itunes"在cmd变量中,if条件应该有效。