1

i want batch file to mask the input with * without extra file

For example

http://pastebin.com/2c4EtG4g

this code is working successfully but it is very slow when i write the letter can any one give my

code is fast and without an extra file ? or edit the code in the link to be fast ??

2 Answers2

1

Does this meet your "no extra file" criterion?

It's a batch file that creates and deletes a tool to get the input, and so it is completely portable, and works in 64 bit machines too.

Herbert Kleebauer wrote the utility and source code can be found on Usenet.

It requires Vista and later I think.

Newsgroups: alt.msdos.batch.nt
Subject: Re: HInput.cmd (new version)
Date: Mon, 25 Feb 2013 19:08:59 +0100

@echo off
certutil -f -decode %~f0 pass.exe>nul
set /p =Enter password: <nul
for /f %%i in ('pass.exe') do set password=%%i
echo.
echo %password%
del pass.exe
pause
goto :eof
-----BEGIN CERTIFICATE-----
TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgaGlzIHByb2dyYW0gcmVx
dWlyZXMgV2luMzIuDQokAFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAEAAAAAAAAAAQAAAAAAAAA
ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
HBAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAcAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAADkBQAAABAAAAACAAAAAgAA
AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABuEAAAfBAAAIwQAACYEAAA
pBAAALYQAAAAAAAAUhAAAAAAAAAAAAAARBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAEtFUk5FTDMyLmRsbAAAbhAAAHwQAACMEAAAmBAAAKQQAAC2EAAAAAAAAAAA
RXhpdFByb2Nlc3MAAABHZXRTdGRIYW5kbGUAAAAAUmVhZEZpbGUAAAAAV3JpdGVG
aWxlAAAAR2V0Q29uc29sZU1vZGUAAAAAU2V0Q29uc29sZU1vZGUAAOiDAAAAPA10
DuguAAAAsCroCAAAAOvp/xUAEEAAUKLMFUAAMcADBdwVQAB1LGr0/xUEEEAAo9wV
QADrHVCizBVAADHAAwXYFUAAdQ1q9f8VBBBAAKPYFUAAagBo4BVAAGoBaMwVQABQ
/xUMEEAACcB1CGoA/xUAEEAAgT3gFUAAAQAAAHXsWMMxwAMF1BVAAHU3avb/FQQQ
QACj1BVAAGjQFUAAUP8VEBBAAIAl0BVAAOH/NdAVQAD/NdQVQAD/FRQQQACh1BVA
AGoAaOAVQABqAWjMFUAAUP8VCBBAAAnAdQhqAP8VABBAAA+2BcwVQACBPeAVQAAB
AAAAdAW4/////8MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA==
-----END CERTIFICATE-----
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
foxidrive
  • 40,353
  • 10
  • 53
  • 68
0

You can do like this :

EDIT :

  @Echo Off  
  :HInput    
  SetLocal DisableDelayedExpansion
Echo Enter your Code :
   Set "Line="
   For /F %%# In (
   '"Prompt;$H&For %%# in (1) Do Rem"'
   ) Do Set "BS=%%#"

  :HILoop
   Set "Key="
   For /F "delims=" %%# In (
   'Xcopy /W "%~f0" "%~f0" 2^>Nul'
   ) Do If Not Defined Key Set "Key=%%#"
   Set "Key=%Key:~-1%"
   SetLocal EnableDelayedExpansion
   If Not Defined Key Goto :HIEnd
  If %BS%==^%Key% (Set /P "=%BS% %BS%" <Nul
   Set "Key="
   If Defined Line Set "Line=!Line:~0,-1!"
   ) Else Set /P "=*" <Nul
   If Not Defined Line (EndLocal &Set "Line=%Key%"
   ) Else For /F delims^=^ eol^= %%# In (
   "!Line!") Do EndLocal &Set "Line=%%#%Key%"
  Goto :HILoop

  :HIEnd
   Echo(
Echo Your code is :  "!Line!"
   Pause
   Goto :Eof
SachaDee
  • 9,245
  • 3
  • 23
  • 33
  • there is problem in the code when i del the letter it will not delete it,it will add * ???? can you fix that ?? – موفق ولي Apr 06 '14 at 11:58
  • You can check my EDIT, but finally you better use the solution you've putted in pastebin. – SachaDee Apr 06 '14 at 13:18
  • there is little error can you fix it (((when i write password and i remove all the letters what i type it, it will show to me echo is off can you fix that to show me like the start of running the code ((blank)) – موفق ولي Apr 06 '14 at 19:44
  • when i match the password the man is write it in the batch file if you not understand goto this link explain what i do and it exit http://pastebin.com/FkQUqvXt – موفق ولي Apr 07 '14 at 05:43