1.

Solve : Input hiding (different from password hiding)?

Answer»

In batch, a user will be entering a password to allow them access, but I want it so someone looking over their shoulder can't see the password (sortof like...not sort of like, exactly like password masking in VB)...

I saw this a while ago, but I can't find it anymore .

I can use a 3rd party program, but it has to be a very small file size (as small as possible!)Here Code: [Select]@ECHO off & setlocal %CheckPWD {[emailprotected] 2008-12-12}%

echo Password:
call :CheckPWD p1 123456 *
echo.
if errorlevel 1 (echo %p1% - No) else (echo %p1% - Yes)

echo.

echo Password:
call :CheckPWD p2 123456
if errorlevel 1 (echo %p2% - No) else (echo %p2% - Yes)

pause & goto :eof






:CheckPWD
setlocal & if "%~2"=="" exit /b 1

for /f "tokens=1 delims=:" %%a in ('findstr /nrc:"^e100 B7 2A 80" "%~f0"') do set /a n=%%a-1
more /e +%n%<"%~f0" | debug>nul

if "%~3"=="" x>nul
if "%~3" neq "" set c=%~3 & call set "c=%%c:~0,1%%"
if "%~3" neq "" x %c%

for /f %%a in ('x -o') do set "p=%%a"

endlocal & set "%~1=%p%" & del x.com & if "%~2"=="%p%" (exit /b 0) else (exit /b 1)

e100 B7 2A 80 3E 80 00 00 74 22 80 3E 80 00 02 75 06
e110 8A 3E 82 00 EB 15 83 E0 00 8E D8 80 3E 00 02 00
e120 74 6A BA 01 02 B4 09 CD 21 EB 61 83 E6 00 8E C6
e130 80 E4 00 CD 16 8A D8 80 FB 1B 75 08 26 80 26 00
e140 02 00 EB 48 80 FB 0D 74 37 80 FB 08 75 1A 83 FE
e150 00 74 DD B2 08 B4 02 CD 21 B2 20 B4 02 CD 21 B2
e160 08 B4 02 CD 21 4E EB C8 80 FB 21 72 C3 80 FB 7E
e170 77 BE 8A D7 B4 02 CD 21 26 88 9C 01 02 46 EB B0
e180 26 C6 84 01 02 24 26 C6 06 00 02 24 B8 00 4C CD
e190 21
nx.com
rcx
91
w
qQuote from: macdad- on April 16, 2009, 08:04:03 PM

Here
Thanks macdad, but I'm afraid that won't work (or I don't know how it could work). What I happens is the user enter's their username, then their password. If the username and password don't match a line in a file, then the user tries again, or gives up...Is there a way that it can MASK the input (like in visual basic), instead of doing it letter by letter?I believe it may be possible in VBScript.Quote from: macdad- on April 18, 2009, 03:22:40 PM
I believe it may be possible in VBScript.
I know absolutely nothing (usefull) in VBScript...can you show me how to/make it?I'm not knowledgeable in VBScript either.

I think Ghostdog is good with it though.

Quote from: macdad- on April 18, 2009, 04:37:11 PM
I'm not knowledgeable in VBScript either.

I think Ghostdog is good with it though.


So, should I post this in "Computer Programming"?Your decision.Quote from: macdad- on April 18, 2009, 04:57:49 PM
Your decision.
Just did. Thanks for your help macdad-!Quote from: macdad- on April 18, 2009, 04:37:11 PM
I'm not knowledgeable in VBScript either.

I think Ghostdog is good with it though.
ghostdog will only suggest you:
- installs gawk, see my sig
- if you are able to download stuffs, you can use sed (check my sig for link).
- if you want to do programming/batching on windows, get a real programming language.
- Switch to *nix then.
-there are abundance of tools out there you can use. the unix Find command , which is ported to windows makes this kind of task seem trivial.
- and many moreThat looks very hard to do. What is the ovjective?
You want the user to type in a passwrod at a prompt from inside a batrch?
The input must not have echo or just *** maybe?
The batch file can retrieve the password from some place the average user would not guess. Right?Quote from: Reno on April 18, 2009, 10:51:39 PM
ghostdog will only suggest you:
for your info, i do GIVE solutions in vbscript sometimes. see here.

Quote
- Switch to *nix then.
don't put words in my mouth.
as for your other comment, i can only say, I advocate using right tools for the job ->> productivity.

@helpmeh, see your other post and also here


Quote from: Reno on April 18, 2009, 10:51:39 PM
ghostdog will only suggest you:
- installs gawk, see my sig
- if you are able to download stuffs, you can use sed (check my sig for link).
- if you want to do programming/batching on windows, get a real programming language.
- Switch to *nix then.
-there are abundance of tools out there you can use. the unix Find command , which is ported to windows makes this kind of task seem trivial.
- and many more

He surpassed himself in the other thread about this topic started by Helpmeh, by posting a link to Experts Exchange (plus the inevitable Perl script)

gawk, or dawk?


Quote from: Dias de verano on April 19, 2009, 02:57:37 AM
He surpassed himself in the other thread about this topic started by Helpmeh, by posting a link to Experts Exchange (plus the inevitable Perl script)

gawk, or dawk?



so do you have a problem with that? or are you purposely being irritating? take a hike. (or take your medicine if you haven't)


Discussion

No Comment Found