我希望密码保护批处理我找到了一种有效的方法但在我的代码是64位机器上出错:
echo off
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>hide.com
:retry
set /p userid=Enter UserId:
echo Technician Name: %userid% >> case.txt
set /p password=Enter password: <nul
for /f "tokens=*" %%i in ('hide.com') do set password=%%i
if /i %password%==password goto next
cls
echo Try again. You are not logged in!
goto retry
:next
echo. & echo You are logged in!
pause
del hide.com
我得到的错误是:
不支持的16位应用程序 由于与64位版本的Windows不兼容,程序或功能“\ ?? \ C:\ Users \ Jamie \ Desktop \ hide.com”无法启动或运行。请与软件供应商联系,询问是否有64位Windows兼容版本。
请帮助
答案 0 :(得分:1)
测试:然后更改未缩进的回显线
::!CARLOS_HIDE_INPUT.BAT
::Code by Carlos on AMBNT 2013-03-10
::Subject: Getkey without Display the input.
::Thread started by jeb
:::::::::::::BEGIN OF CODE:::::::::::::
@Echo Off
:HInput
::Version 3.0
SetLocal DisableDelayedExpansion
Echo Enter your password below:
Set "Line="
Rem Save 0x08 character in BS variable
For /F %%# In (
'"Prompt;$H&For %%# in (1) Do Rem"'
) Do Set "BS=%%#"
:HILoop
Set "Key="
For /F "delims=" %%# In (
'Xcopy /L /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 password is '!Line!'
Pause
Goto :Eof
::::::::::::::END OF CODE::::::::::::::
答案 1 :(得分:0)
两种使用外部免费可执行文件的解决方案:
editv64.exe。这有一个-m参数用于屏蔽输入(显示&#39; *&#39;用于键入的字符)。这是一个用于编辑环境变量的通用工具。到达这里:http://www.westmesatech.com/editv.html。不受限制的受版权保护的免费软件,但是封闭源代码。
带-h参数的ReadLine.exe。这将读取隐藏的输入(在您键入时不显示任何内容),并将您键入的输入输出到标准输出。如果没有-h参数,此工具也可以预先填充输入行。到达这里:http://www.westmesatech.com/misctools.html。受版权保护的免费软件;来源包括。
答案 2 :(得分:-1)
尝试这样的事情:
echo off
REM Find out if we're running as 64-bit
IF NOT "%PROCESSOR_ARCHITECTURE%"=="x86" (
ECHO.Relaunching the script in a 32-bit process...
%SYSTEMROOT%\SysWow64\cmd.exe /c "%0"
GOTO :EOF
)
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>hide.com
:retry
set /p userid=Enter UserId:
echo Technician Name: %userid% >> case.txt
set /p password=Enter password: <nul
for /f "tokens=*" %%i in ('hide.com') do set password=%%i
if /i %password%==password goto next
cls
echo Try again. You are not logged in!
goto retry
:next
echo. & echo You are logged in!
pause
del hide.com
我添加了一些功能,可检测当前架构,并在32位进程中重新启动BAT,如果它当前不在32位进程中。