Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi guys,
I would like to create a box that pops up which looks something like this:
Enter password:
****
[ OK ] [ CANCEL ]Is this possible. I have tried using wbat 2.43, but I am finding it hard to use. Otherwise, what would be a good way of doing this command line (so the password is masked)?
Thanks.

Hi Adam,
No obvious way to make it echo **** instead of the actual chars typed in.
M2
If at first you don't succeed, you're about average.

Got it done using wbat. The point of having a password is that most people with little knowledge will know how to get it. The password is read from a another file called c:\win.dll. All my variable names are hard to understand, so a user would not make much sense of it.

I admit this is a bit buggy but a start.
The password when entered will be seen as XXX on the screen.Buggy? Runs of cd in win 98 but not on the hd...hmmm xp just plain hates it. 95 on one machine loves it and another always goes to the death label. Haven't played with it since
91..............auugh!
@ECHO OFF
REM NAME: PASSWORD.BAT
REM PURPOSE: Batch Password
REM VERSION: 1.51
REM DATE: March 25, 1991NEEDHELP %0 %1
IF ERRORLEVEL 1 GOTO HELPCLS
CTTY NUL
SET COUNTER=1
ECHO Enter Password > CONREM Enter Three Digit Password Here
REM A=ASCII Value Of First Digit
REM C=ASCII Value Of Second Digit
REM E=ASCII Value Of Third Digit
REM Run FINDPASS.BAT To Find These
REM If You Are Not Sure What To Use-----
REM Change These Numbers
REM To Change Password
-----
SET A=82
SET C=79
SET E=78
-----REM Need To Develop The Second Number
REM To Use In The Dual If-Tests
SET MATH=%A%
BATCMD AD
SET B=%MATH%
SET MATH=%C%
BATCMD AD
SET D=%MATH%
SET MATH=%E%
BATCMD AD
SET F=%MATH%
SET MATH=:TOP
BATCMD GK<CON
IF ERRORLEVEL %A% IF NOT ERRORLEVEL %B% GOTO SECOND
IF %COUNTER%==1 GOTO 1
IF %COUNTER%==2 GOTO 2
IF %COUNTER%==3 GOTO 3
GOTO TOP:SECOND
ECHO X>CON
BATCMD GK<CON
IF ERRORLEVEL %C% IF NOT ERRORLEVEL %D% GOTO THIRD
IF %COUNTER%==1 GOTO 1
IF %COUNTER%==2 GOTO 2
IF %COUNTER%==3 GOTO 3
GOTO SECOND:THIRD
ECHO XX>CON
BATCMD GK<CON
IF ERRORLEVEL %E% IF NOT ERRORLEVEL %F% GOTO CORRECT
IF %COUNTER%==1 GOTO 1
IF %COUNTER%==2 GOTO 2
IF %COUNTER%==3 GOTO 3
GOTO THIRD:1
ECHO Wrong Password, Start Over > CON
SET COUNTER=2
GOTO TOP:2
ECHO Wrong Password, Start Over > CON
SET COUNTER=3
GOTO TOP:3
CLS > CON
BATCMD PC 12 38 > CON
ECHO --DEATH-- > CON
:DEATH
GOTO DEATH:CORRECT
FOR %%J IN (A B C D E F COUNTER) DO SET %%J=
CTTY CON
GOTO END:HELP
ECHO This Demonstration Batch File Requires
ECHO The User To Enter A Password Before
ECHO It Continues And The User Can Not
ECHO Break Out By Pressing Control-Break
ECHO Or Any Other Method
BATCMD SL
ECHO The Demonstration Password Is RON
ECHO And The Capitalization Must
ECHO Match Exactly
GOTO END:END
Raintree

Hi WL,
It's anything but obvious where you're headed with this, but a few things stand out in the opening lines.
I guess NEEDHELP is another BAT.
In 2k, and I suppose XP, there is no CTTY.
This:
:DEATH
GOTO DEATHlooks like a recipe for an endless loop.
M2
If at first you don't succeed, you're about average.

Going with this? LOL! It has not been out of the file cab since 91.....and will most likly be a rainy day project to finish and then go back.
The post was to give an example of how to mask the password. It could be berrys and display orange. An onlooker would then have the wrong password.
Never stated that it was compleate.
Ouch! Was it supposed to be? Oh No!Let me know if you get into an endless loop:=:)
Raintree

![]() |
need MS-DOS 7.1
|
Dos 7.10
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |