China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-22 14:45
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Code for batch input password without displaying characters View 22,853 Replies 64
Original Poster Posted 2007-01-17 10:45 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

: by Herbert Kleebauer
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
echo hP1X500Pf3/f1/5++u5x>in.com
set /p password=Enter password:<nul
for /f "tokens=*" %%i in ('in.com') do set password=%%i
pause
del in.com
echo.
echo The Password is:"%password%"


Using set /p to input the password directly displays the characters, which doesn't look good. So I found this code on USENET, tested it under Vista, and Herbert Kleebauer is really awesome.

[ Last edited by electronixtar on 2007-1-17 at 11:42 AM ]
Recent Ratings for This Post ( 5 in total) Click for details
RaterScoreTime
redtek +11 2007-01-21 21:16
lg560852 +1 2007-02-02 11:14
sisos +1 2007-04-18 07:57
everest79 +15 2007-04-18 09:32
kennyfan +2 2009-02-15 21:00

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 2 Posted 2007-01-17 10:55 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Indeed amazing, but during testing, the displayed password had an extra space compared to what I actually entered. I don't know why. It should be related to that in.com program.
Floor 3 Posted 2007-01-17 11:29 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Such small mistakes are not a big deal~~ Hehe

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 4 Posted 2007-01-17 11:30 ·  中国 广西 贵港 电信
高级用户
★★
学无尽止
Credits 635
Posts 244
Joined 2006-04-15 05:07
20-year member
UID 53857
Gender Male
From 广西贵港
Status Offline
Hehe, this might need to be used. The method of entering the password in ftp under CMD should be the same, right~
学无尽止
Floor 5 Posted 2007-01-17 11:32 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
It's not a problem with in.com, but there is an extra space after the line "for /f "tokens=*" %%i in ('in.com') do set password=%%i " ^_^
Floor 6 Posted 2007-01-17 11:34 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Hehe, didn't look carefully.
Floor 7 Posted 2007-01-17 11:39 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
PS: Not support Chinese display, but you can add chcp 936>nul later to display Chinese

[ Last edited by zh159 on 2007-1-16 at 10:43 PM ]
Floor 8 Posted 2007-01-17 11:43 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Modified, heh heh


Does not support Chinese display

This is the case when writing assembly in batch processing, heh heh

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 9 Posted 2007-01-17 13:13 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
19-year member
UID 58987
From 湖南.娄底
Status Offline
hP1X500Pf3/f1/5++u5x

High, really high. I don't know how this com can achieve input with just this line of code. If it weren't for the fact that the binary code of this simple character is machine language that receives input from the input device (keyboard) until the enter key is pressed.

Unfortunately, such an in.com is a 16-bit program and does not support Chinese display. Fortunately, the willsort moderator (although willsort has left, he is still a moderator of the alliance...) has an original post that enables 16-bit programs to support Chinese display, using graftabl.exe.


@echo off

chcp 437>nul&graftabl 936>nul

echo hP1X500Pf3/f1/5++u5x>in.com

set /p password=请输入密码:<nul

for /f "tokens=*" %%i in ('in.com') do set password=%%i

del in.com

echo.

echo The Password is:"%password%"

pause


Finally found willsort's that post, Chinese in the command line.

http://www.cn-dos.net/forum/viewthread.php?tid=20682&fpage=1

[ Last edited by pengfei on 2007-1-17 at 01:17 PM ]
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
vkill +5 2007-01-22 08:26
redtek +11 2007-01-22 11:22
kennyfan +2 2009-02-15 21:09
业精于勤而荒于嬉,形成于思而毁于随。
Floor 10 Posted 2007-01-17 14:00 ·  中国 北京 联通
初级用户
Credits 47
Posts 24
Joined 2007-01-09 00:03
19-year member
UID 75873
Gender Male
Status Offline
Really want to know how this big shot got the string "hP1X500Pf3/f1/5++u5x", and after generating a .com file, it can still execute. Recently, when browsing the forum, I seem to have seen a showwin.com. I wonder if it's from the same author. What's the principle here? Which friend can come out and explain it?

[ Last edited by kernelv on 2007-1-17 at 01:06 AM ]
Floor 11 Posted 2007-01-17 15:10 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by pengfei at 2007-1-17 00:13:
hP1X500Pf3/f1/5++u5x

High, really high, I don't know how this com can achieve input with only this line of code. If the binary code of this simple character is not from the input device (key ...

Cool!!!
Floor 12 Posted 2007-01-17 21:49 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Brother electronixtar has taken batch processing applications to a new level~ :)))))
Super top!!!
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 13 Posted 2007-01-17 23:03 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline
That in.com file can be opened with Notepad
I've already seen it long ago

But I don't know the principle, it can do not display
Floor 14 Posted 2007-01-17 23:09 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline
And changing in.com to in.exe is also okay
Floor 15 Posted 2007-01-18 00:14 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

I don't know if it's the same author. What's the principle here? Could any friend come out to explain it?

Of course it's the same author, the German expert Herbert Kleebauer

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
1 2 3 5 Next ›
Forum Jump: