批处理窗口立即打开和关闭?

时间:2014-06-19 16:41:46

标签: batch-file window

我的批处理文件中有这个代码,但是当我打开它时,它会立即关闭。我该怎么办?它应该工作而不添加任何暂停。

@echo off
color f0
:start1
cls
set /a wait=50000
set /a limit=2147483646
set /a current=0
echo WAITING ROOM SIMULATOR 2014
echo Current Number:%current%
echo Your number is 2,147,483,647
goto loop1
:loop1
set /a wait=%wait%-50000
set /a current=%current%+1
if current=limit goto pause1
goto start2
:loop2
set /a wait=%wait%+1
if %wait%=50000 goto loop1
:start2
cls
echo WAITING ROOM SIMULATOR 2014
echo Current Number:%current%
echo Your number is 2,147,483,647
goto loop2
:pause1
goto pause2
:pause2
goto pause1

1 个答案:

答案 0 :(得分:0)

好像你有语法问题,特别是if current=limit goto pause1if %wait%=50000 goto loop1请看下面的固定文件:

@echo off
color f0
:start1
cls
set /a wait=50000
set /a limit=2147483646
set /a current=0
echo WAITING ROOM SIMULATOR 2014
echo Current Number:%current%
echo Your number is 2,147,483,647
goto loop1
:loop1
set /a wait=%wait%-50000
set /a current=%current%+1
if %current%==%limit% goto pause1
goto start2
:loop2
set /a wait=%wait%+1
if %wait%==50000 goto loop1
:start2
cls
echo WAITING ROOM SIMULATOR 2014
echo Current Number:%current%
echo Your number is 2,147,483,647
goto loop2
:pause1
goto pause2
:pause2
goto pause1