Time limit on CMD window to close
Posted: 04 May 2011 13:35
Hi,
I have three batch files that link together. The first one, (which asks for a password) triggers the second one, (which runs through random numbers as if it were decoding something) which then triggers the third one (which shows "decoded" information). Here are the codes for all three files:
First one:
:wrong
@echo off
title Rotor Encryption Coding
color 00
cls
echo Enter Password
set /p input= :
IF '%input%' == 'wytuxa' goto menu
goto error
:error
cls
echo Access Denied.
pause nul
goto wrong
:menu
echo Password Correct
start "c:\Users\Matthew\Desktop\-" "c:\Users\Matthew\Desktop\-\Matrix.BAT"
Second one:
@echo off
title System Decryption
set /a counta=1
:start
if %counta% equ 4000 goto end
set /a counta=%counta%+1
color 00
echo %random%%random% %random%%random% %random%%random% %random%%random% %random%%random% %random%%random%
goto start
:end
goto new window
:new window
start "c:\Users\Matthew\Desktop" "c:\Users\Matthew\Desktop\test2.BAT"
pause
Third one:
@echo off
title Decrypted Intelligence
colour 00
cls
echo Decrypted Intelligence: HELP
echo.
echo Please press ANY key to EXIT
pause> nul
:end
'j' goto menu
:menu
it
to exittcho exit
.................................
The problem i have is that when i start the sequence off and it runs through batch file 1, 2 and finally three, i have 3 saying 'press any key to exit' but it doesn't exit when you press any key, it just state my c:\ and then goes to the next line!
How do i fix that?
The Second thing i want to do is put a time limit on the Batch file windows, for example, when batch file 2 opens i want it to automatically close after 20 seconds and when batch file 3 is open i want it to close after 10 seconds.
How do i do this?
Regards
Matt
I have three batch files that link together. The first one, (which asks for a password) triggers the second one, (which runs through random numbers as if it were decoding something) which then triggers the third one (which shows "decoded" information). Here are the codes for all three files:
First one:
:wrong
@echo off
title Rotor Encryption Coding
color 00
cls
echo Enter Password
set /p input= :
IF '%input%' == 'wytuxa' goto menu
goto error
:error
cls
echo Access Denied.
pause nul
goto wrong
:menu
echo Password Correct
start "c:\Users\Matthew\Desktop\-" "c:\Users\Matthew\Desktop\-\Matrix.BAT"
Second one:
@echo off
title System Decryption
set /a counta=1
:start
if %counta% equ 4000 goto end
set /a counta=%counta%+1
color 00
echo %random%%random% %random%%random% %random%%random% %random%%random% %random%%random% %random%%random%
goto start
:end
goto new window
:new window
start "c:\Users\Matthew\Desktop" "c:\Users\Matthew\Desktop\test2.BAT"
pause
Third one:
@echo off
title Decrypted Intelligence
colour 00
cls
echo Decrypted Intelligence: HELP
echo.
echo Please press ANY key to EXIT
pause> nul
:end
'j' goto menu
:menu
it
to exittcho exit
.................................
The problem i have is that when i start the sequence off and it runs through batch file 1, 2 and finally three, i have 3 saying 'press any key to exit' but it doesn't exit when you press any key, it just state my c:\ and then goes to the next line!
How do i fix that?
The Second thing i want to do is put a time limit on the Batch file windows, for example, when batch file 2 opens i want it to automatically close after 20 seconds and when batch file 3 is open i want it to close after 10 seconds.
How do i do this?
Regards
Matt