@echo off & setlocal DisableDelayedExpansion
set counter=4
:senha
Title %~n0
Mode 50,5 & Color 0e
if %counter% equ 0 goto :senha2
set /p input="Enter Username: "
set "psCommand=powershell -Command "$pword = read-host 'Enter password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p
)
if %input%==joao123 (
if %password%==1234 goto :Senha4
)
goto :senha3
:senha2
echo
echo Account Locked Out Timeout In 5
timeout /t 5
exit
:senha3
echo,
set /a counter -=1
echo.
@echo on
@echo off
color 40
echo USERNAME OR PASSWORD INCORRETO(S)
echo.
if %counter% lss 4 echo %counter% tentativas restantes
pause
goto senha
:senha4
echo Username and Passwords corretos!
color 0a
pause
Question
nxcau 0
SCRIPT:
@echo off & setlocal DisableDelayedExpansion
set counter=4
:senha
Title %~n0
Mode 50,5 & Color 0e
if %counter% equ 0 goto :senha2
set /p input="Enter Username: "
set "psCommand=powershell -Command "$pword = read-host 'Enter password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p
)
if %input%==joao123 (
if %password%==1234 goto :Senha4
)
goto :senha3
:senha2
echo
echo Account Locked Out Timeout In 5
timeout /t 5
exit
:senha3
echo,
set /a counter -=1
echo.
@echo on
@echo off
color 40
echo USERNAME OR PASSWORD INCORRETO(S)
echo.
if %counter% lss 4 echo %counter% tentativas restantes
pause
goto senha
:senha4
Edited by nxcauecho Username and Passwords corretos!
color 0a
pause
Link to post
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.