
CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion
call :test bbb
pause&goto :eof
:test
set %1=aaa
if "!%1!"=="aaa" echo is aaa.
CODE: [Copy to clipboard]我想知道有没有别的更好的方法呢?我希望尽量不要输出文件,因为如果是echo那样的语句那倒还可以,如果是goto的话,批处理已经执行到别的文件上了,跳不回来的啊set %1=aaa
echo if "%%%1%%"=="aaa" echo aaa >tmp.bat
call tmp.bat
del tmp.bat
CODE: [Copy to clipboard][ Last edited by netbenton on 2010-6-9 at 16:17 ]@echo off
set %1=:sub
echo set %%1=%%%1%%>>tmp.bat
call tmp.bat abc
goto %abc%
:sub
echo 跳转成功
:end
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |