China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 22:35
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Variable issue with a batch password View 581 Replies 1
Original Poster Posted 2008-03-26 18:37 ·  中国 河南 驻马店 电信
初级用户
Credits 22
Posts 9
Joined 2008-03-21 10:57
18-year member
UID 113575
Gender Male
Status Offline
@echo off
@title Let batch files handle everything~ by:bowen
color 0a
MODE con: COLS=50 LINES=27
set ci=3
echo.
echo Note: three wrong entries will exit. If you don't know the password, then don't come in~~
echo.
:1
set /p ad=Please enter password:

if "%ad%" == "?????" goto o

set /a ci-=1
if \"%ci%\"==\"0\" cls&echo.&echo ====Trying to come in without the password!!!====No way!!!====&echo.&pause&echo.&exit
cls&echo.&echo You still have %ci% chances&echo.&goto 1
:o
cls&echo.
echo ============ The password seems correct~~, access granted ============



What I want to ask is, the red part is the password, and it gets displayed directly like this, which isn't good. Is there some way to use variables for it? For example, something like 5*5*5* or an expression like 5+5+5, of course it can be a bit more complex, like exponentiation. How would that be written?? I mainly just want to add a little bit of obfuscation, nothing too complicated, just enough to make other people unable to figure it out

[ Last edited by bowen666 on 2008-3-25 at 10:38 PM ]
Floor 2 Posted 2008-03-26 19:10 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
See set /a
Forum Jump: