我希望批处理文件在没有额外文件的情况下用 * 屏蔽输入
例如
http://pastebin.com/2c4EtG4g
这段代码工作成功,但是当我写信时它很慢,任何人都可以给我的
代码很快,没有额外的文件?或者编辑链接中的代码以快速??
这是否符合您的"无额外文件"标准?
它是一个批处理文件,用于创建和删除工具来获取输入,因此它是完全可移植的,也可以在 64 位机器中使用。
Herbert Kleebauer编写了该实用程序,源代码可以在Usenet上找到。
它需要Vista,后来我认为。
新闻组: alt.msdos.batch.nt
主题:回复:HInput.cmd(新版本)
日期:2013 年 2 月 25 日星期一 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-----
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
你可以这样做:
编辑:
@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