mlsb.net
相关文档
当前位置:首页 >> BAt ElsEiF >>

BAt ElsEiF

没有,不过里边可以套IF命令 set p=1set x=8if %p% == 2 (echo 正确) else (if %x% == 8 (echo x值是对的) else (echo X值是错的))

::══代══码══开══始═══ @echo off title 窗口模式设置 color 1c set/p mode=是否选用最大窗口模式(Y/N)?: if /i %mode%==Y (goto max) else goto min :max start /max set.bat exit :min start set.bat exit ::══代══码══结══束═══ ::加上括号...

@echo off :start set /p first="请选择,输入1运行1号程序,输入2运行2号程序:" if %first% LEQ 2 ( goto first ) else ( echo 输入错误!请重新输入! goto start ) :first IF %first% == 1 goto one ELSE goto two exit :one rem 这里是你要执行...

批处理不支持此命令else 可改成 @echo off :start echo testting if exist test.txt goto pass :fail echo fail pause goto start :pass echo find file echo not find file ) 批处理不支持此命令else可改成@echo off:startecho testtingif exis...

@echo off & title 获取WinRAR程序路径 By 依梦琴瑶:GetWinRarPathif /i "%PROCESSOR_IDENTIFIER:~,3%"=="x86" ( set type=exe32) Else ( set type=exe64)for /f "tokens=2*" %%i in ('reg query "HKLM\SOFTWARE\WinRAR" /v "%type%"') do (set ...

@echo off set /p notifyType=“输入1,否则错误” if "%notifyType%"=="1" ( 括号前面至少要有一个空格 echo ok ) else ( else要和if前面的结束括号)和自身的括号(在同一行 echo no )

set flag="true" if %flag% == "true" (echo aaa) else (echo bbb)

if %a% == 1 if %b% == 2 echo aaaaa if not %a% == 1 if %b% == 2 echo bbbb if %a% == 1 if not %b% == 2 echo bbbb if not %a% == 1 if not %b% == 2 echo cccc 很麻烦,但是批处理也只能这么写了,批处理只是dos的延伸,说到底设计之初就没...

不是每一个IF都必须套一个else,第一个正确代码如下: @echo off :start set /p a=press a key: IF %a% NEQ 1 ( IF %a% NEQ 2 ( IF %a% NEQ 3 ( IF %a% NEQ 4 (goto :start) ELSE (goto :end)))) :end goto :eof

把括号的位置改一改 @echo off set aaa=123 echo %aaa%>>C:\text.txt if %aaa% LSS 1000 ( set bbb=111 ) else ( set bbb=222 ) echo %bbb%>>C:\text.txt pause

网站首页 | 网站地图
All rights reserved Powered by www.mlsb.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com