本帖最后由 apang 于 2013-10-17 18:25 编辑
保存为test.bat,需要strings和wbat- @echo off
- :_Loop
- cls
- set var=
- set Input=456
- set Num=123
- call w.bat box @test.bat:_Choice #1
- if errorlevel 100 goto _Exit
- if %?%#==1# goto _Start
- if %?%#==2# goto _Exit
-
- :_Choice "输入比较的数值:"
-
- [$Input,8,U! ]
-
- [ 确定(&S)] [ 取消(&C)]
- ::
-
- :_Start
- strings var=SUB %Input%,%Num% 2>nul
- if errorlevel 1 goto _Lss
- if %var%#==0# goto _Equ
- echo ">"
- pause
- goto _Loop
-
- :_Equ
- echo "="
- pause
- goto _Loop
-
- :_Lss
- echo "<"
- pause
- goto _Loop
-
- :_Exit
- exit
复制代码 用 strings 除法运算貌似不行,改成减法运算 |