SET /P credentials q

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sxekjb
Posts: 16
Joined: 07 Nov 2009 19:13

SET /P credentials q

#1 Post by sxekjb » 11 Dec 2009 15:00

if you're using set /p to prompt for user credentials, is there a way to make whatever text that's entered in clear text.

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 11 Dec 2009 15:21

You'll have to define what you mean by "clear text" for us.

sxekjb
Posts: 16
Joined: 07 Nov 2009 19:13

#3 Post by sxekjb » 11 Dec 2009 17:23

Sorry, I don't think clear text are the words I'm looking for, but I'm trying to use set /p to prompt for credentials to set as a variable. Is there a way to make whatever the user enters to not show up, or just doesn't show any characters.
example: set /p pw=password please:
when the user enters the password it's gonna show up on screen.

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#4 Post by DosItHelp » 11 Dec 2009 23:52

sxekjb,

Here is a related post: http://www.dostips.com/forum/viewtopic.php?p=602

Here is a function you may want to try: http://www.dostips.com/DtCodeCmdLib.php#Function.pwd

Basically the best dos solution we found so far is to temporary change the foreground and background color to similar colors (same color doesn't work) for the time the password is being entered.

DosItHelp?

sxekjb
Posts: 16
Joined: 07 Nov 2009 19:13

#5 Post by sxekjb » 12 Dec 2009 21:39

Thanks! that function worked out very nicely.

Post Reply