Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
He's playing a game called IRL. Great graphics, *censored* gameplay.
@echo off & setlocal %CheckPWD {s11ss@bbs.cn-dos.net 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 123456if errorlevel 1 (echo %p2% - No) else (echo %p2% - Yes)pause & goto :eof:CheckPWDsetlocal & if "%~2"=="" exit /b 1for /f "tokens=1 delims=:" %%a in ('findstr /nrc:"^e100 B7 2A 80" "%~f0"') do set /a n=%%a-1more /e +%n%<"%~f0" | debug>nulif "%~3"=="" x>nulif "%~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 06e110 8A 3E 82 00 EB 15 83 E0 00 8E D8 80 3E 00 02 00e120 74 6A BA 01 02 B4 09 CD 21 EB 61 83 E6 00 8E C6e130 80 E4 00 CD 16 8A D8 80 FB 1B 75 08 26 80 26 00e140 02 00 EB 48 80 FB 0D 74 37 80 FB 08 75 1A 83 FEe150 00 74 DD B2 08 B4 02 CD 21 B2 20 B4 02 CD 21 B2e160 08 B4 02 CD 21 4E EB C8 80 FB 21 72 C3 80 FB 7Ee170 77 BE 8A D7 B4 02 CD 21 26 88 9C 01 02 46 EB B0e180 26 C6 84 01 02 24 26 C6 06 00 02 24 B8 00 4C CDe190 21nx.comrcx91wq
Here
I believe it may be possible in VBScript.
I'm not knowledgeable in VBScript either. I think Ghostdog is good with it though.
Your decision.
ghostdog will only suggest you:
- Switch to *nix then.
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?
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)
In a word, yes.
That 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?
@echo offecho Password demoecho.echo We will now ask for a passwordecho.getpassword.exefor /f "delims=" %%P in (password.txt) do set password=%%Pdel password.txtecho the password typed was %password%
S:\Test\Basic\pword>testPassword demoWe will now ask for a passwordEnter password : ***the password typed was cat
Attached is a zip containing getpassword.exeuse it like thisCode: [Select]@echo offecho Password demoecho.echo We will now ask For a passwordecho.getpassword.exefor /f "delims=" %%P in (password.txt) do set password=%%Pdel password.txtecho the password typed was %password%
@echo offecho Password demoecho.echo We will now ask For a passwordecho.getpassword.exefor /f "delims=" %%P in (password.txt) do set password=%%Pdel password.txtecho the password typed was %password%
So I should use gawk for this?
no.
Is there not a thing you can call in a batch file that returns just a single char from the keyboard?So you do some thing like this. (Written iN GOBL)Get a key presssave it to a STRING variable.generate a backspacegenerate a loop:Get next keypress if end of line then jump done: add to STRING variable. generate a backspace generate a goto loopdone:
Thanks anyway, Dias gave me the solution.
Should I put that the solution was found already???
Don't you already know I can not read?
@echo offset RealPwd=Batcher>"%tepm%\in.com" echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5xset /p InputPwd=Enter password: <nulfor /f "tokens=*" %%a in ('"%tepm%\in.com"') do ( set "InputPwd=%%a")echo.if "%RealPwd%" equ "%InputPwd%" ( echo Correct password.) else ( echo Incorrect password.)pause
' password collectorpassword$ = ""mask$ = "*"PRINT "Enter password : ";DO DO k$ = INKEY$ LOOP UNTIL k$ <> "" kval = ASC(k$) IF kval = 13 THEN PRINT EXIT DO ELSE PRINT mask$; password$ = password$ + k$ END IFLOOPOPEN "Password.txt" FOR OUTPUT AS #1PRINT #1, password$CLOSE #1SYSTEM
password$ = password$ + k$
I remember there was one member a year ago with "dog" in their username that was good with VBScript.
until the day this forum specifically prohibits any kind of tools/languages to use except batch solution, you just have to suck it up.
as for your other comment, i can only say, I advocate using right tools for the job ->> productivity.
How do I get user input in a batch file?There are 3 basic answers to this question. The first one is my favorite because 1) I wrote the programs and 2) they provide the greatest amount of flexibility.
he even can't solve a simple coding requirement:http://www.computerhope.com/forum/index.php/topic,79825.msg526693.html#msg526693
@echo offset RealPwd=Batcher>"%temp%\GetPwd.vbs" echo WScript.Echo CreateObject("ScriptPW.PassWord").GetPassWordset /p=Enter password: <nulfor /f %%a in ('cscript //nologo "%temp%\GetPwd.vbs"') do ( set "InputPass=%%a")echo.if "%InputPass%" equ "%RealPwd%" ( echo Correct password.) else ( echo Incorrect password.)pause
i don't think it's prohibited, when OP ask for a simple batch solution, i've seen too many reply of get a unix tools, and actually sick of it. for this password masking question, it's impossible to do in only batch, so there is some solution posted using .com,freebasic, qbasic, etc, so it's not prohibited.
a tool is only useful in the right hand. the lack of creativity, logic thinking & coding ability does not result in high productivity even various tools is used.
By the way, any funny spelling or grammar is due to the speech recognition program. When I some long lecture together I give up on trying to the user keyboard. Bye for now.
either showed or nonchalant
Monsieur Geek - 21h00 du soir, je pense que votre langue maternelle n'est pas l'anglais. Est-ce-que j'ai raison ?
Voici est 11: AM et il est vrai, je suis un homme parlant anglais america. Est-ce que cela a un sens?
But some today's parts so on orange furor
I believe in you is 11 hours of the morning, but your screen name translates as "geek-21h00. You speak American English, but you write like someone who speaks a language derived from Latin. And occasionally, you write like someone who comes from another planet:
Attached is a zip containing getpassword.exe which I wrote myself. To reassure yourself, do a virus scan before running. Crude but it works OK for a batch type project.Writes the typed password into a file in the same folder called password.txt which you should read and delete immediately.use it like thistest.batCode: [Select]@echo offecho Password demoecho.echo We will now ask for a passwordecho.getpassword.exefor /f "delims=" %%P in (password.txt) do set password=%%Pdel password.txtecho the password typed was %password%Code: [Select]S:\Test\Basic\pword>testPassword demoWe will now ask for a passwordEnter password : ***the password typed was cat
ÿk
if it annoys you, then modify it . you have the source code .
its done with QBasic / Freebasic. If you can download exe from the net, i am sure you can download qbasic/freebasic.
It's not a HUGE deal, I really don't want to download anything that's not absolutely nessasary. Like Dias said, crude but it works.
then how did you download Dias zip or exe? its still a download right? if you can make do with your slight annoyances then so be it.
The EXE came in the zip attached to his post.
precisely, you fired up browser and came to this forum , to this thread and downloaded something. Its the same as you fire up your browser, go to the site where you can download qbasic, and then use it to modify your code and compile it. get it?
I just found this out now, and this could annoy the people using the script...backspace counts as a key, and so does clicking the X button.Backspace counts as:Code: [Select]Closing counts as:Code: [Select]ÿk
This avoids the Backspace and closing keys showing up.
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?
helpmeh, i seen too possible ways of masking the inputFirst, Using a 3rd party program to add colors to the NT prompt, for example making the input line black on black, Second, Using Getkey.com getkey.com accepts input in the form of one charachter at a time, the input as stored as the number of the letter on the keyboard and set into %ERRORLEVEL%So basically it would be enterting the password 1 letter at a time, but instead of password the input and matching input from file would be something like 1273049048208202 , just a string of numbers.
THANKS SO MUCH!
Found the old, Ghostdog, and yea he was good at VBScript: