2014-02-13 64 views
0

我要用密码保护一批我发现工作,但得到一个错误,在64台机器上我的代码的方式获取隐藏的密码:在64位Windows批处理文件

echo off 
echo hP1X500P[PZBBBfh#b##[email protected]`$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位应用程序 程序或功能“\ ?? \ C:\用户\杰米·\桌面\ hide.com”不能由于与Windows的64位版本incompatibity启动或运行。请联系软件供应商,询问是否有64位Windows兼容版本可用。

请帮助

+0

谁写的加密器?还有其他的可用 - 例如:http://www.robvanderwoude.com/scriptcompilers.php - 虽然不是批处理脚本,AutoIT/AutoHotKey也可以工作 - http://alternativeto.net/software/winbatch/ – Leptonator

回答

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

尝试是这样的回声线:

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##[email protected]`$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位进程中,则在32位进程中重新启动BAT。

+1

64位Windows无法运行MS-DOS可执行文件(16位),因此即使以32位启动,该解决方案根本无法在64位平台上运行。 –

+0

@Bill_Stewart好的。我确信我读到了“16位”的音符,但在我脑海中想着64和32。 – NickS

0

两个解决方案,使用外部无成本的可执行文件:

  1. editv64.exe。这有一个用于屏蔽输入的-m参数(为键入的字符显示'*')。这是一个编辑环境变量的通用工具。到这里:http://www.westmesatech.com/editv.html。无限制版权的免费软件,但是是封闭的。

  2. 带-h参数的ReadLine.exe。这会读取隐藏的输入(键入时不显示任何内容),并将输入的输入输出到标准输出。没有-h参数,这个工具也可以预先填充输入行。到这里:http://www.westmesatech.com/misctools.html。有版权的免费软件;包括来源。