'其他'不被识别为一个内部或外部命令,可操作的程序或批处理文件 [英] 'else' is not recognized as an internal or external command, operable program or batch file

查看:587
本文介绍了'其他'不被识别为一个内部或外部命令,可操作的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用其他命令来使用,但我得到的foloowing错误:

I try to use with "else" command but I get the foloowing error:

'其他'不是内部或外部命令,
可运行的程序或批处理文件。

我的code是:

if "zz"=="TRUE" (
        copy /a zz + /a ee=/a zz
    ) 
    else (
        copy /a e + /a %TMP%=/a e
    )

什么问题?

推荐答案

其他需要在同一行(一)如果。前取出新行其他像这样:

The else needs to be on the same "line" (a) as the if. Remove the new-line before the else like so:

if "zz"=="TRUE" (
    copy /a zz + /a ee=/a zz
) else (
    copy /a e + /a %TMP%=/a e
)

另外请注意,ZZ==TRUE将永远不会计算为真正 - 我怀疑你意味着ZZ%%==TRUE

Please also note that "zz"=="TRUE" will never evaluate to true - I suspect you meant "%zz%"=="TRUE"?

(一):这并不总是一个很好的说明,但它是微软的文档使用什么。同样的命令的可能是更好的,并把其他在不同的换行符入的两个的命令。

(a): This isn't always a good description, though it's what the Microsoft documents use. Same command may have been better, and putting ) and else on a different line breaks it into two commands.

这篇关于'其他'不被识别为一个内部或外部命令,可操作的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆