Computing.Net > Forums > Disk Operating System > create a pasword box in dos

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

create a pasword box in dos

Reply to Message Icon

Name: nmv (by AP81)
Date: April 27, 2005 at 03:21:52 Pacific
OS: Win Me
CPU/Ram: 512
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: April 27, 2005 at 04:52:07 Pacific
Reply:

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.


0

Response Number 2
Name: wizard-fred
Date: April 27, 2005 at 09:07:20 Pacific
Reply:

What is the point of a password prompt, when it can so easily bypassed?


0

Response Number 3
Name: nmv (by AP81)
Date: April 28, 2005 at 01:54:25 Pacific
Reply:

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.


0

Response Number 4
Name: Raintree
Date: May 2, 2005 at 10:29:28 Pacific
Reply:

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, 1991

NEEDHELP %0 %1
IF ERRORLEVEL 1 GOTO HELP

CLS
CTTY NUL
SET COUNTER=1
ECHO Enter Password > CON

REM 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


0

Response Number 5
Name: Mechanix2Go
Date: May 3, 2005 at 02:49:43 Pacific
Reply:

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 DEATH

looks like a recipe for an endless loop.

M2


If at first you don't succeed, you're about average.


0

Related Posts

See More



Response Number 6
Name: Raintree
Date: May 3, 2005 at 08:26:03 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

need MS-DOS 7.1 Dos 7.10



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: create a pasword box in dos

How do u create a new drive in ms-dos www.computing.net/answers/dos/how-do-u-create-a-new-drive-in-msdos/9830.html

How to create a log file in 1 line www.computing.net/answers/dos/how-to-create-a-log-file-in-1-line/12735.html

how do you copy a:\ to C:\ in dos 6.22 www.computing.net/answers/dos/how-do-you-copy-a-to-c-in-dos-622/7709.html