Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Input hiding (different from password hiding)  (Read 29326 times)

0 Members and 2 Guests are viewing this topic.

Helpmeh

    Topic Starter


    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Input hiding (different from password hiding)
« on: April 16, 2009, 03:08:19 PM »
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!)
« Last Edit: April 22, 2009, 07:16:17 PM by Helpmeh »
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

macdad-



    Expert

    Thanked: 40
    Re: Input hiding (different from password hiding)
    « Reply #1 on: April 16, 2009, 08:04:03 PM »
    Here  ;)
    If you dont know DOS, you dont know Windows...

    Thats why Bill Gates created the Windows NT Family.

    Prince_



      Beginner

      Thanked: 5
      Re: Input hiding (different from password hiding)
      « Reply #2 on: April 17, 2009, 06:51:19 AM »
      Code: [Select]
      @echo off & setlocal        %CheckPWD {[email protected] 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
      q

      Helpmeh

        Topic Starter


        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: Input hiding (different from password hiding)
      « Reply #3 on: April 18, 2009, 02:34:44 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?
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      macdad-



        Expert

        Thanked: 40
        Re: Input hiding (different from password hiding)
        « Reply #4 on: April 18, 2009, 03:22:40 PM »
        I believe it may be possible in VBScript.
        If you dont know DOS, you dont know Windows...

        Thats why Bill Gates created the Windows NT Family.

        Helpmeh

          Topic Starter


          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: Input hiding (different from password hiding)
        « Reply #5 on: April 18, 2009, 04:16:12 PM »
        I believe it may be possible in VBScript.
        I know absolutely nothing (usefull) in VBScript...can you show me how to/make it?
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        macdad-



          Expert

          Thanked: 40
          Re: Input hiding (different from password hiding)
          « Reply #6 on: April 18, 2009, 04:37:11 PM »
          I'm not knowledgeable in VBScript either.   :P

          I think Ghostdog is good with it though.

          If you dont know DOS, you dont know Windows...

          Thats why Bill Gates created the Windows NT Family.

          Helpmeh

            Topic Starter


            Guru

          • Roar.
          • Thanked: 123
            • Yes
            • Yes
          • Computer: Specs
          • Experience: Familiar
          • OS: Windows 8
          Re: Input hiding (different from password hiding)
          « Reply #7 on: April 18, 2009, 04:51:28 PM »
          I'm not knowledgeable in VBScript either.   :P

          I think Ghostdog is good with it though.


          So, should I post this in "Computer Programming"?
          Where's MagicSpeed?
          Quote from: 'matt'
          He's playing a game called IRL. Great graphics, *censored* gameplay.

          macdad-



            Expert

            Thanked: 40
            Re: Input hiding (different from password hiding)
            « Reply #8 on: April 18, 2009, 04:57:49 PM »
            Your decision.
            If you dont know DOS, you dont know Windows...

            Thats why Bill Gates created the Windows NT Family.

            Helpmeh

              Topic Starter


              Guru

            • Roar.
            • Thanked: 123
              • Yes
              • Yes
            • Computer: Specs
            • Experience: Familiar
            • OS: Windows 8
            Re: Input hiding (different from password hiding)
            « Reply #9 on: April 18, 2009, 05:04:05 PM »
            Your decision.
            Just did. Thanks for your help macdad-!
            Where's MagicSpeed?
            Quote from: 'matt'
            He's playing a game called IRL. Great graphics, *censored* gameplay.

            Reno



              Hopeful
            • Thanked: 32
              Re: Input hiding (different from password hiding)
              « Reply #10 on: April 18, 2009, 10:51:39 PM »
              I'm not knowledgeable in VBScript either.   :P

              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 more

              Geek-9pm


                Mastermind
              • Geek After Dark
              • Thanked: 1026
                • Gekk9pm bnlog
              • Certifications: List
              • Computer: Specs
              • Experience: Expert
              • OS: Windows 10
              Re: Input hiding (different from password hiding)
              « Reply #11 on: April 18, 2009, 11:03:59 PM »
              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?

              gh0std0g74



                Apprentice

                Thanked: 37
                Re: Input hiding (different from password hiding)
                « Reply #12 on: April 19, 2009, 02:39:08 AM »
                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



                Dias de verano

                • Guest
                Re: Input hiding (different from password hiding)
                « Reply #13 on: April 19, 2009, 02:57:37 AM »
                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?



                gh0std0g74



                  Apprentice

                  Thanked: 37
                  Re: Input hiding (different from password hiding)
                  « Reply #14 on: April 19, 2009, 03:17:58 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)

                  Dias de verano

                  • Guest
                  Re: Input hiding (different from password hiding)
                  « Reply #15 on: April 19, 2009, 03:34:54 AM »
                  so do you have a problem with that?

                  In a word, yes.

                  Quote
                  or are you purposely being irritating?

                  In another word, yes.

                  Quote
                  take a hike. (or take your medicine if you haven't)

                  Demonstrating that "Dawk" was an apposite comment.





                  gh0std0g74



                    Apprentice

                    Thanked: 37
                    Re: Input hiding (different from password hiding)
                    « Reply #16 on: April 19, 2009, 05:07:58 AM »
                    In a word, yes.
                    until the day this forum specifically prohibits any kind of tools/languages to use except batch solution, you just have to suck it up.


                    Dias de verano

                    • Guest
                    Re: Input hiding (different from password hiding)
                    « Reply #17 on: April 19, 2009, 05:09:18 AM »
                    It all gets me nearer to 5000...

                    Helpmeh

                      Topic Starter


                      Guru

                    • Roar.
                    • Thanked: 123
                      • Yes
                      • Yes
                    • Computer: Specs
                    • Experience: Familiar
                    • OS: Windows 8
                    Re: Input hiding (different from password hiding)
                    « Reply #18 on: April 19, 2009, 08:17:30 AM »
                    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?
                    I am trying to MASK the input at a prompt. I'm currently using set /p, but when a user enters their password, it shows up as letters. Someone could "casually" look over their shoulder and see their password. Like the Passwordbox in VB2008 replaces any entered letters with * (or dots depending on version).

                    So I should use gawk for this? Is it a single executable file (I won't be able to install anything, but I can place single .exe s in a file)?
                    Where's MagicSpeed?
                    Quote from: 'matt'
                    He's playing a game called IRL. Great graphics, *censored* gameplay.

                    Dias de verano

                    • Guest
                    Re: Input hiding (different from password hiding)
                    « Reply #19 on: April 19, 2009, 08:51:46 AM »
                    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 this

                    test.bat

                    Code: [Select]
                    @echo off
                    echo Password demo
                    echo.
                    echo We will now ask for a password
                    echo.
                    getpassword.exe
                    for /f "delims=" %%P in (password.txt) do set password=%%P
                    del password.txt
                    echo the password typed was %password%


                    Code: [Select]
                    S:\Test\Basic\pword>test
                    Password demo

                    We will now ask for a password

                    Enter password : ***
                    the password typed was cat




                    [attachment deleted by admin]

                    Helpmeh

                      Topic Starter


                      Guru

                    • Roar.
                    • Thanked: 123
                      • Yes
                      • Yes
                    • Computer: Specs
                    • Experience: Familiar
                    • OS: Windows 8
                    Re: Input hiding (different from password hiding)
                    « Reply #20 on: April 19, 2009, 08:58:28 AM »
                    Attached is a zip containing getpassword.exe

                    use it like this

                    Code: [Select]
                    @echo off
                    echo Password demo
                    echo.
                    echo We will now ask For a password
                    echo.
                    getpassword.exe
                    for /f "delims=" %%P in (password.txt) do set password=%%P
                    del password.txt
                    echo the password typed was %password%

                    THANKS SO MUCH!
                    Where's MagicSpeed?
                    Quote from: 'matt'
                    He's playing a game called IRL. Great graphics, *censored* gameplay.

                    gh0std0g74



                      Apprentice

                      Thanked: 37
                      Re: Input hiding (different from password hiding)
                      « Reply #21 on: April 19, 2009, 09:36:42 AM »
                      So I should use gawk for this?
                      no.

                      Helpmeh

                        Topic Starter


                        Guru

                      • Roar.
                      • Thanked: 123
                        • Yes
                        • Yes
                      • Computer: Specs
                      • Experience: Familiar
                      • OS: Windows 8
                      Re: Input hiding (different from password hiding)
                      « Reply #22 on: April 19, 2009, 09:51:20 AM »
                      no.
                      Thanks anyway, Dias gave me the solution.
                      Where's MagicSpeed?
                      Quote from: 'matt'
                      He's playing a game called IRL. Great graphics, *censored* gameplay.

                      macdad-



                        Expert

                        Thanked: 40
                        Re: Input hiding (different from password hiding)
                        « Reply #23 on: April 19, 2009, 02:35:13 PM »
                        I remember there was one member a year ago with "dog" in their username that was good with VBScript.
                        If you dont know DOS, you dont know Windows...

                        Thats why Bill Gates created the Windows NT Family.

                        Geek-9pm


                          Mastermind
                        • Geek After Dark
                        • Thanked: 1026
                          • Gekk9pm bnlog
                        • Certifications: List
                        • Computer: Specs
                        • Experience: Expert
                        • OS: Windows 10
                        Re: Input hiding (different from password hiding)
                        « Reply #24 on: April 19, 2009, 05:11:23 PM »
                        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 press
                        save it to a STRING variable.
                        generate a backspace
                        generate a
                        loop:
                        Get next keypress
                        if end of line then  jump done:
                          add to STRING variable.
                          generate a backspace
                          generate a
                          goto loop
                        done:



                        Helpmeh

                          Topic Starter


                          Guru

                        • Roar.
                        • Thanked: 123
                          • Yes
                          • Yes
                        • Computer: Specs
                        • Experience: Familiar
                        • OS: Windows 8
                        Re: Input hiding (different from password hiding)
                        « Reply #25 on: April 19, 2009, 05:26:59 PM »
                        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 press
                        save it to a STRING variable.
                        generate a backspace
                        generate a
                        loop:
                        Get next keypress
                        if end of line then  jump done:
                          add to STRING variable.
                          generate a backspace
                          generate a
                          goto loop
                        done:



                        Should I put that the solution was found already???
                        Thanks anyway, Dias gave me the solution.

                        Where's MagicSpeed?
                        Quote from: 'matt'
                        He's playing a game called IRL. Great graphics, *censored* gameplay.

                        Geek-9pm


                          Mastermind
                        • Geek After Dark
                        • Thanked: 1026
                          • Gekk9pm bnlog
                        • Certifications: List
                        • Computer: Specs
                        • Experience: Expert
                        • OS: Windows 10
                        Re: Input hiding (different from password hiding)
                        « Reply #26 on: April 19, 2009, 05:39:40 PM »
                        Quote
                        Should I put that the solution was found already???

                        Don't you already know I can not read?

                        Helpmeh

                          Topic Starter


                          Guru

                        • Roar.
                        • Thanked: 123
                          • Yes
                          • Yes
                        • Computer: Specs
                        • Experience: Familiar
                        • OS: Windows 8
                        Re: Input hiding (different from password hiding)
                        « Reply #27 on: April 19, 2009, 05:41:16 PM »
                        Don't you already know I can not read?
                        I do...I just felt like rubbing it in...
                        Where's MagicSpeed?
                        Quote from: 'matt'
                        He's playing a game called IRL. Great graphics, *censored* gameplay.

                        Batcher



                          Rookie

                          Thanked: 5
                          Re: Input hiding (different from password hiding)
                          « Reply #28 on: April 19, 2009, 09:41:20 PM »
                          Code: [Select]
                          @echo off
                          set RealPwd=Batcher
                          >"%tepm%\in.com" echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5x
                          set /p InputPwd=Enter password: <nul
                          for /f "tokens=*" %%a in ('"%tepm%\in.com"') do (
                            set "InputPwd=%%a"
                          )
                          echo.
                          if "%RealPwd%" equ "%InputPwd%" (
                            echo Correct password.
                          ) else (
                            echo Incorrect password.
                          )
                          pause

                          BC_Programmer


                            Mastermind
                          • Typing is no substitute for thinking.
                          • Thanked: 1140
                            • Yes
                            • Yes
                            • BC-Programming.com
                          • Certifications: List
                          • Computer: Specs
                          • Experience: Beginner
                          • OS: Windows 11
                          Re: Input hiding (different from password hiding)
                          « Reply #29 on: April 19, 2009, 11:31:21 PM »
                          *Modifies BCScripts Scripting Object to take a password char with ReadLn()*
                          I was trying to dereference Null Pointers before it was cool.

                          Dias de verano

                          • Guest
                          Re: Input hiding (different from password hiding)
                          « Reply #30 on: April 20, 2009, 12:50:17 AM »
                          Source code for program attached to post previously.

                          Code: [Select]

                          ' password collector
                          password$ = ""
                          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 IF
                          LOOP
                          OPEN "Password.txt" FOR OUTPUT AS #1
                          PRINT #1, password$
                          CLOSE #1
                          SYSTEM               


                          The only thing I had to do to make it work in both Freebasic and QBasic was to change this line

                          Code: [Select]
                                          password$ = password$ + k$
                          the + string concatenation symbol is accepted by both compilers/interpreters, but the & character, which I at first used, only works in Freebasic.

                          Refinements might be to pass the wording of the prompt, the masking character, and the output filename as parameters. Possibly it might be better to avoid using a file for the typed characters by outputting the typed in text to stdout and using FOR to swallow it. However it's just a toy program so maybe there's not much point in all of that.

                          Also maybe it would be better, in the calling batch, to overwrite the file containing the typed in password, rather than just deleting it. E.g.

                          echo Hello World>password.txt



                          Reno



                            Hopeful
                          • Thanked: 32
                            Re: Input hiding (different from password hiding)
                            « Reply #31 on: April 20, 2009, 01:57:59 AM »
                            I remember there was one member a year ago with "dog" in their username that was good with VBScript.
                            i am sure it's not ghostdog.
                            madcad, i don't know where you get the idea that ghostdog is good at vbscript.
                            he even can't solve a simple coding requirement:
                            http://www.computerhope.com/forum/index.php/topic,79825.msg526693.html#msg526693
                            he only have a lot of generic code from google, but don't have the ability to modify it.

                            until the day this forum specifically prohibits any kind of tools/languages to use except batch solution, you just have to suck it up.
                            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.

                            as for your other comment, i can only say, I advocate using right tools for the job ->> productivity.
                            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.

                            Geek-9pm


                              Mastermind
                            • Geek After Dark
                            • Thanked: 1026
                              • Gekk9pm bnlog
                            • Certifications: List
                            • Computer: Specs
                            • Experience: Expert
                            • OS: Windows 10
                            Re: Input hiding (different from password hiding)
                            « Reply #32 on: April 20, 2009, 02:25:23 AM »
                            This thread has gone far too long. But it draws lots of lookers.
                            This has all been done years ago and beaten into the ground. And if that was not enough, now we want to break off its tail after chasing it into shallow hole.
                            Look at Bill Stewart's Site :
                            Quote
                            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.
                            http://www.westmesatech.com/cmdprompt.html
                            And there are many others, who knows who did it first.

                            BC_Programmer


                              Mastermind
                            • Typing is no substitute for thinking.
                            • Thanked: 1140
                              • Yes
                              • Yes
                              • BC-Programming.com
                            • Certifications: List
                            • Computer: Specs
                            • Experience: Beginner
                            • OS: Windows 11
                            Re: Input hiding (different from password hiding)
                            « Reply #33 on: April 20, 2009, 02:43:24 AM »
                            Quote
                            he even can't solve a simple coding requirement:
                            http://www.computerhope.com/forum/index.php/topic,79825.msg526693.html#msg526693


                            I don't see anybody else making an effort.

                            I have to agree that it get's old recommending various scripting languages all over the place, but that's no reason to try to shoot down a solution he provided- even if it doesn't meet the requirements- because his posts were the only ones trying to help the original poster.

                            yours just complain about it not working, and Dias's is telling you to calm down. A sentiment I must agree with.
                            I was trying to dereference Null Pointers before it was cool.

                            Batcher



                              Rookie

                              Thanked: 5
                              Re: Input hiding (different from password hiding)
                              « Reply #34 on: April 20, 2009, 02:43:56 AM »
                              Code: [Select]
                              @echo off
                              set RealPwd=Batcher
                              >"%temp%\GetPwd.vbs" echo WScript.Echo CreateObject("ScriptPW.PassWord").GetPassWord
                              set /p=Enter password: <nul
                              for /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

                              gh0std0g74



                                Apprentice

                                Thanked: 37
                                Re: Input hiding (different from password hiding)
                                « Reply #35 on: April 20, 2009, 03:13:58 AM »
                                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.
                                dude, the replies  and solutions i posted is for the OP. the one to get sick or not is not you, but the OP. Oh, so you mean doing something in Freebasic, qbasic and converting it to exe and then putting it into a batch file is ok, but using tools like gawk.exe or sed.exe is not ok? I can convert the Perl code i posted to exe too, does that count? why don't you think out of the box?

                                Quote
                                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.
                                its worse when you have creativity, logic thinking & coding ability but without a good tool to use.
                                I am just about done with you. the last thing i want to say to you, if you are so free (to get sick), why don't you go fly a kite?

                                macdad-



                                  Expert

                                  Thanked: 40
                                  Re: Input hiding (different from password hiding)
                                  « Reply #36 on: April 20, 2009, 05:53:25 AM »
                                  No, no there was one person about a year ago who was good at VBScript.
                                  If you dont know DOS, you dont know Windows...

                                  Thats why Bill Gates created the Windows NT Family.

                                  Geek-9pm


                                    Mastermind
                                  • Geek After Dark
                                  • Thanked: 1026
                                    • Gekk9pm bnlog
                                  • Certifications: List
                                  • Computer: Specs
                                  • Experience: Expert
                                  • OS: Windows 10
                                  Re: Input hiding (different from password hiding)
                                  « Reply #37 on: April 20, 2009, 11:21:28 AM »
                                  Dear Topic St artier,  R U still there?

                                  Hello, perhaps I had been hard or unkind.  Please accept my apology.
                                  Your code is difficult to understand.  Good programming practice is to comment code and break it into smaller parts so as to help others to understand what you're doing.  Also, when you go back to your code months later it will be easy to understand why you did a certain thing.
                                  Yesterday originally the batch commands were intended for simple jobs like to to copy files to rename files and in find a certain types of files in the directories.  Later, Microsoft added some more features to the command set.  Many of these were simply extensions for code that was already inside the command interpreter.  However, the extensions were not what we would call elegance or intuitive.  The ability to search for substrate in the command line or again a text file is a rather awkward feature of the command language.  It helps if there is a notation that helps others understand what you are doing when you're looking for substrate.
                                  Also, the command language does not have, by itself, a graceful way to take input from the user.  So some external program is often used for this purpose, one of these was the program called choice.com, which is not inside a the command interpreter, is actually another program that stands by itself.
                                  To solve the password hiding questions, or any situation where you want to hide the user input, many programmers will suggest using one of the external programs to take the user input and either showed or nonchalant according to some switches the program accept.
                                  Of course, there is awaited the using just the things that are inside the badge commands.  But some today's parts so on orange furor that many people would choose not to do it that way.
                                  A few years ago when MS-DOS was very popular people use the are ANSI system to write colorful images in the upper left corner every time he got a prompt.  Sometime later this sort of thing faded from use, and she decided to become more familiar with a graphical user interface of Windows and no longer were interested in drawing pictures on the screen inside a DOS.  However, the graphical capabilities of the ANSI system would make it possible for you to hide the user input and thus that would be one way to solve this problem.  And it would not require any external programs.  But it would require that the DOS would have to love the ANSI system before the station started.
                                  Well, that is the end of my lecture for today.  Thank you for listening.
                                  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.







                                  BC_Programmer


                                    Mastermind
                                  • Typing is no substitute for thinking.
                                  • Thanked: 1140
                                    • Yes
                                    • Yes
                                    • BC-Programming.com
                                  • Certifications: List
                                  • Computer: Specs
                                  • Experience: Beginner
                                  • OS: Windows 11
                                  Re: Input hiding (different from password hiding)
                                  « Reply #38 on: April 20, 2009, 11:23:43 AM »
                                  Quote
                                  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.


                                  AHHH! Now it all makes sense.

                                  that explains a lot of spelling/weird words in some of your previous posts.
                                  I was trying to dereference Null Pointers before it was cool.

                                  Dias de verano

                                  • Guest
                                  Re: Input hiding (different from password hiding)
                                  « Reply #39 on: April 20, 2009, 11:42:27 AM »
                                  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 ?

                                  BC_Programmer


                                    Mastermind
                                  • Typing is no substitute for thinking.
                                  • Thanked: 1140
                                    • Yes
                                    • Yes
                                    • BC-Programming.com
                                  • Certifications: List
                                  • Computer: Specs
                                  • Experience: Beginner
                                  • OS: Windows 11
                                  Re: Input hiding (different from password hiding)
                                  « Reply #40 on: April 20, 2009, 11:45:43 AM »
                                  I'm pretty sure that's french. something about his mother's native language? or Mother tongue?

                                  I was trying to dereference Null Pointers before it was cool.

                                  macdad-



                                    Expert

                                    Thanked: 40
                                    Re: Input hiding (different from password hiding)
                                    « Reply #41 on: April 20, 2009, 11:48:26 AM »
                                    Back on topic...

                                    If you dont know DOS, you dont know Windows...

                                    Thats why Bill Gates created the Windows NT Family.

                                    BC_Programmer


                                      Mastermind
                                    • Typing is no substitute for thinking.
                                    • Thanked: 1140
                                      • Yes
                                      • Yes
                                      • BC-Programming.com
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Beginner
                                    • OS: Windows 11
                                    Re: Input hiding (different from password hiding)
                                    « Reply #42 on: April 20, 2009, 11:58:16 AM »
                                    back on topic indeed.

                                    my latest compile of BCScript and BASeParser XP have the ability to prompt for input via a password without any extra code. Just pass a pw character, and it does the rest.
                                    I was trying to dereference Null Pointers before it was cool.

                                    Geek-9pm


                                      Mastermind
                                    • Geek After Dark
                                    • Thanked: 1026
                                      • Gekk9pm bnlog
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: Input hiding (different from password hiding)
                                    « Reply #43 on: April 20, 2009, 12:02:37 PM »
                                    Quote
                                    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?

                                    Dias de verano

                                    • Guest
                                    Re: Input hiding (different from password hiding)
                                    « Reply #44 on: April 20, 2009, 12:45:40 PM »
                                    Voici est 11: AM et il est vrai, je suis un homme parlant anglais america. Est-ce que cela a un sens?

                                    Je crois que chez vous l'heure est 11 du matin, mais votre nom d'écran se traduit comme "geek-21h00".

                                    Vous parlez anglais américain, mais vous écrivez un peu comme quelqu'un qui parle une langue derivée du Latin.

                                    Et de temps en temps, vous écrivez comme quelqu'un qui vient d'une autre planète:

                                    Quote
                                    But some today's parts so on orange furor







                                    Geek-9pm


                                      Mastermind
                                    • Geek After Dark
                                    • Thanked: 1026
                                      • Gekk9pm bnlog
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: Input hiding (different from password hiding)
                                    « Reply #45 on: April 20, 2009, 01:03:29 PM »
                                    What he said is more or less:

                                    Quote
                                    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:

                                    ...from another planet

                                    I have been told to avoid talking about my origin, All I am allowed to say here is that I am not of this world. But that is off topic anyway. You might start a poll on the forum about how many visitors you have like me. You could be surprised, The two of use are not the only ones.



                                    Helpmeh

                                      Topic Starter


                                      Guru

                                    • Roar.
                                    • Thanked: 123
                                      • Yes
                                      • Yes
                                    • Computer: Specs
                                    • Experience: Familiar
                                    • OS: Windows 8
                                    Re: Input hiding (different from password hiding)
                                    « Reply #46 on: April 22, 2009, 02:58:05 PM »
                                    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 this

                                    test.bat

                                    Code: [Select]
                                    @echo off
                                    echo Password demo
                                    echo.
                                    echo We will now ask for a password
                                    echo.
                                    getpassword.exe
                                    for /f "delims=" %%P in (password.txt) do set password=%%P
                                    del password.txt
                                    echo the password typed was %password%


                                    Code: [Select]
                                    S:\Test\Basic\pword>test
                                    Password demo

                                    We will now ask for a password

                                    Enter password : ***
                                    the password typed was cat




                                    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
                                    Where's MagicSpeed?
                                    Quote from: 'matt'
                                    He's playing a game called IRL. Great graphics, *censored* gameplay.

                                    gh0std0g74



                                      Apprentice

                                      Thanked: 37
                                      Re: Input hiding (different from password hiding)
                                      « Reply #47 on: April 22, 2009, 06:46:54 PM »
                                      if it annoys you, then modify it . you have the source code .

                                      Helpmeh

                                        Topic Starter


                                        Guru

                                      • Roar.
                                      • Thanked: 123
                                        • Yes
                                        • Yes
                                      • Computer: Specs
                                      • Experience: Familiar
                                      • OS: Windows 8
                                      Re: Input hiding (different from password hiding)
                                      « Reply #48 on: April 22, 2009, 06:48:57 PM »
                                      if it annoys you, then modify it . you have the source code .
                                      It's an EXE file.
                                      Where's MagicSpeed?
                                      Quote from: 'matt'
                                      He's playing a game called IRL. Great graphics, *censored* gameplay.

                                      gh0std0g74



                                        Apprentice

                                        Thanked: 37
                                        Re: Input hiding (different from password hiding)
                                        « Reply #49 on: April 22, 2009, 06:54:27 PM »
                                        its done with QBasic / Freebasic. If you can download exe from the net, i am sure you can download qbasic/freebasic.

                                        Helpmeh

                                          Topic Starter


                                          Guru

                                        • Roar.
                                        • Thanked: 123
                                          • Yes
                                          • Yes
                                        • Computer: Specs
                                        • Experience: Familiar
                                        • OS: Windows 8
                                        Re: Input hiding (different from password hiding)
                                        « Reply #50 on: April 22, 2009, 06:58:22 PM »
                                        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.
                                        Where's MagicSpeed?
                                        Quote from: 'matt'
                                        He's playing a game called IRL. Great graphics, *censored* gameplay.

                                        gh0std0g74



                                          Apprentice

                                          Thanked: 37
                                          Re: Input hiding (different from password hiding)
                                          « Reply #51 on: April 22, 2009, 07:17:11 PM »
                                          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.

                                          Helpmeh

                                            Topic Starter


                                            Guru

                                          • Roar.
                                          • Thanked: 123
                                            • Yes
                                            • Yes
                                          • Computer: Specs
                                          • Experience: Familiar
                                          • OS: Windows 8
                                          Re: Input hiding (different from password hiding)
                                          « Reply #52 on: April 22, 2009, 07:18:05 PM »
                                          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.
                                          Where's MagicSpeed?
                                          Quote from: 'matt'
                                          He's playing a game called IRL. Great graphics, *censored* gameplay.

                                          gh0std0g74



                                            Apprentice

                                            Thanked: 37
                                            Re: Input hiding (different from password hiding)
                                            « Reply #53 on: April 22, 2009, 07:24:46 PM »
                                            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?

                                            Helpmeh

                                              Topic Starter


                                              Guru

                                            • Roar.
                                            • Thanked: 123
                                              • Yes
                                              • Yes
                                            • Computer: Specs
                                            • Experience: Familiar
                                            • OS: Windows 8
                                            Re: Input hiding (different from password hiding)
                                            « Reply #54 on: April 22, 2009, 07:26:35 PM »
                                            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 looked at the code, and it was a fair bit confusing...I really don't want to learn another language, just to make something like 2% better...when chances are people won't be needing it anyway.
                                            Where's MagicSpeed?
                                            Quote from: 'matt'
                                            He's playing a game called IRL. Great graphics, *censored* gameplay.

                                            Dias de verano

                                            • Guest
                                            Re: Input hiding (different from password hiding)
                                            « Reply #55 on: April 23, 2009, 12:16:14 AM »
                                            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

                                            So what? Why are these problems?

                                            BC_Programmer


                                              Mastermind
                                            • Typing is no substitute for thinking.
                                            • Thanked: 1140
                                              • Yes
                                              • Yes
                                              • BC-Programming.com
                                            • Certifications: List
                                            • Computer: Specs
                                            • Experience: Beginner
                                            • OS: Windows 11
                                            Re: Input hiding (different from password hiding)
                                            « Reply #56 on: April 23, 2009, 09:41:08 AM »
                                            backspace, after all, is a key.
                                            I was trying to dereference Null Pointers before it was cool.

                                            macdad-



                                              Expert

                                              Thanked: 40
                                              Re: Input hiding (different from password hiding)
                                              « Reply #57 on: April 23, 2009, 11:13:29 AM »
                                              Here  ;)

                                              This avoids the Backspace and closing keys showing up.
                                              If you dont know DOS, you dont know Windows...

                                              Thats why Bill Gates created the Windows NT Family.

                                              Helpmeh

                                                Topic Starter


                                                Guru

                                              • Roar.
                                              • Thanked: 123
                                                • Yes
                                                • Yes
                                              • Computer: Specs
                                              • Experience: Familiar
                                              • OS: Windows 8
                                              Re: Input hiding (different from password hiding)
                                              « Reply #58 on: April 23, 2009, 02:32:51 PM »
                                              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?
                                              Where's MagicSpeed?
                                              Quote from: 'matt'
                                              He's playing a game called IRL. Great graphics, *censored* gameplay.

                                              614olbaid



                                                Rookie

                                                Re: Input hiding (different from password hiding)
                                                « Reply #59 on: April 23, 2009, 03:06:32 PM »

                                                helpmeh, i seen too possible ways of masking the input

                                                First, 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.

                                                Helpmeh

                                                  Topic Starter


                                                  Guru

                                                • Roar.
                                                • Thanked: 123
                                                  • Yes
                                                  • Yes
                                                • Computer: Specs
                                                • Experience: Familiar
                                                • OS: Windows 8
                                                Re: Input hiding (different from password hiding)
                                                « Reply #60 on: April 23, 2009, 03:09:28 PM »
                                                helpmeh, i seen too possible ways of masking the input

                                                First, 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!

                                                Already solved...
                                                Where's MagicSpeed?
                                                Quote from: 'matt'
                                                He's playing a game called IRL. Great graphics, *censored* gameplay.

                                                macdad-



                                                  Expert

                                                  Thanked: 40
                                                  Re: Input hiding (different from password hiding)
                                                  « Reply #61 on: April 25, 2009, 02:39:37 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

                                                  Found the old, Ghostdog, and yea he was good at VBScript:
                                                  http://www.computerhope.com/forum/index.php/topic,36934.0.html
                                                  If you dont know DOS, you dont know Windows...

                                                  Thats why Bill Gates created the Windows NT Family.

                                                  gh0std0g74



                                                    Apprentice

                                                    Thanked: 37
                                                    Re: Input hiding (different from password hiding)
                                                    « Reply #62 on: April 25, 2009, 06:31:11 PM »
                                                    Found the old, Ghostdog, and yea he was good at VBScript:
                                                    the old ghostdog74 = gh0std0g74. and no, i am not really good at vbscript. i just know some to get by . :)