求助
bat吧
全部回复
仅看楼主
level 10
喏,就是说bb.txt中数值第一行是225
而bbb.txt中数值第一行是224
让批处理检测出两个数值不一样,就执行命令例如goto 1
如果一样,就执行例如goto 2
谢谢大家!
2015年12月05日 13点12分 1
level 14
是只有一行吗
如果是
set /p %bb%=<\bb.txt
set /p %bbb%=<\bb.txt
if "%bbb%" neq "%bb%" goto 1 else goto2
2015年12月05日 14点12分 2
level 14
如果有多行:
for /f skip=0 tokens=* delims=" %%i in (bbb.txt) do (
set bbb=%%i)
for /f skip=0 tokens=* delims=" %%i in (bb.txt) do (
set bb=%%i)
if "%bbb%" neq "%bb%" goto 1 else goto2
大概没写错
2015年12月05日 14点12分 3
level 14
有人吗?这几天好像都没人理我[泪]
2015年12月05日 14点12分 4
level 10
不行
2015年12月05日 14点12分 5
level 14
set /p %bb%=<bb.txt
set /p %bbb%=<bbb.txt
if "%bbb%" neq "%bb%" goto 1 else goto2
2015年12月05日 14点12分 6
果然写错了,上次把exist写成find
2015年12月05日 14点12分
啊啊啊
2015年12月06日 13点12分
level 10
@tjugerkfer 都不对,返回来的值都是0,而且不会goto 醉了。。
2015年12月06日 03点12分 7
level 14
set /p _1=<"bb.txt"
set /p _2=<"bbb.txt"
if not "%_1%"=="%_2%" (
goto 1
) else goto 2
2015年12月06日 08点12分 8
@- 再或者连else一块省了
2015年12月06日 13点12分
正解[哈哈]
2015年12月07日 05点12分
1