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:49
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Code for batch input password without displaying characters View 22,855 Replies 64
Floor 31 Posted 2007-02-02 04:12 ·  中国 重庆 璧山区 电信
初级用户
Credits 58
Posts 31
Joined 2007-01-06 11:16
19-year member
UID 75621
Gender Male
From 重庆
Status Offline
Floor 32 Posted 2007-02-04 01:13 ·  中国 山西 太原 电信
初级用户
Credits 56
Posts 22
Joined 2006-12-13 10:54
19-year member
UID 73399
Gender Male
Status Offline
Wow, that's amazing! Using IN.COM to record the keys entered before the carriage return and then set them as the password to be displayed! I really have to admire it!
Floor 33 Posted 2007-04-18 09:50 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 259
Posts 112
Joined 2006-09-18 04:55
19-year member
UID 62928
Gender Male
Status Offline
Very wonderful.. Hehe, learned!
Floor 34 Posted 2007-04-18 11:35 ·  中国 陕西 西安 电信
初级用户
★★
Credits 112
Posts 50
Joined 2007-04-15 00:59
19-year member
UID 85191
Gender Male
Status Offline
Still don't understand, but thank you, the landlord!
Floor 35 Posted 2007-04-18 11:45 ·  中国 广西 梧州 电信
初级用户
Credits 29
Posts 12
Joined 2007-03-16 04:29
19-year member
UID 81902
Gender Male
Status Offline
Hey..Although I know it.. but I still can't understand it.. heh heh..
Floor 36 Posted 2007-04-18 14:45 ·  中国 云南 红河哈尼族彝族自治州 开远市 电信
初级用户
Credits 111
Posts 44
Joined 2007-03-12 16:00
19-year member
UID 81515
Gender Male
Status Offline
PPdos

@echo off
title A timeout occurs, please press Enter to continue:
:begin
PING 127.0 -t|set /p pwd=Please enter the password:&cls>con
set /p pwd=
cls&echo Password is:%pwd%
if "%pwd%"=="" cls&goto begin
pause>nul


This can adjust the delay to infinite~~!
Can you experiment to see if it works?
Floor 37 Posted 2007-04-18 21:24 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Originally posted by sd287054 at 2007-4-18 14:45:
PPdos

@echo off
title 出现表示 输入超时请按回车继续:
:begin
PING 127.0 -t|set /p pwd=请输入密码:&cls>con
set /p pwd=
cls&echo 密码为:%pwd%
if "%pwd%&q ...

Can't run.
Windows 一键还原
http://www.yjhy.com
Floor 38 Posted 2007-04-18 22:04 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by PPdos at 2007-1-21 09:24:
@echo off
title 出现表示 输入超时请按回车继续:
:begin
PING 127.0|set /p pwd=请输入密码:&cls>con
set /p pwd=
cls&echo 密码为:%pwd%
if "%pwd%"=="" cls&goto begin
pause>nul

After research, the above code can realize hidden input of the password without generating temporary files

But it will expose the unentered password after the delay time exceeds. I hope experts can improve it!

This is using the cache (with length limit) effect of the keyboard operation of cmd. Before the delay ends, input the password and press Enter. When the delay ends, it is directly accepted by "set /p pwd=", which is not a real hidden input of the password

If there is no Enter before the delay ends, the cached keyboard operation will be displayed; if there is Enter before the delay ends, "set /p pwd=" after the delay ends will execute all keyboard operations together, which is extremely difficult to see the display of the password (theoretically it will also be displayed, but the speed is too fast)
Floor 39 Posted 2007-04-19 00:56 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
Floor 40 Posted 2007-04-22 04:27 ·  中国 江苏 无锡 电信
初级用户
Credits 80
Posts 43
Joined 2007-04-21 23:44
19-year member
UID 86017
Gender Male
Status Offline
Hehe, I also come to pay respects.
Floor 41 Posted 2007-04-22 13:14 ·  中国 云南 红河哈尼族彝族自治州 开远市 电信
初级用户
Credits 111
Posts 44
Joined 2007-03-12 16:00
19-year member
UID 81515
Gender Male
Status Offline
PPdos

@echo off
title 出现表示 输入超时请按回车继续:
:begin
PING -n 10 127.0 |set /p pwd=请输入密码:&cls>con
set /p pwd=
cls&echo 密码为:%pwd%
if "%pwd%"=="" cls&goto begin
pause>nul
Incorrect parameters added,
This way you can delay for 10 seconds
Floor 42 Posted 2007-06-20 15:13 ·  中国 广东 深圳 联通
新手上路
唐白虎
Credits 11
Posts 5
Joined 2007-06-20 14:38
19-year member
UID 91882
Gender Male
From 廣東深圳
Status Offline
Floor 43 Posted 2007-06-20 17:25 ·  中国 广东 肇庆 电信
初级用户
★★
Credits 152
Posts 74
Joined 2005-12-01 23:06
20-year member
UID 46314
Status Offline
Floor 44 Posted 2007-06-20 18:48 ·  中国 福建 厦门 电信
新手上路
Credits 3
Posts 1
Joined 2007-05-13 15:46
19-year member
UID 88411
Gender Male
Status Offline
This is exactly what I want. Really awesome
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
+1 2007-06-20 18:53
Floor 45 Posted 2007-06-20 19:49 ·  中国 广东 深圳 联通
初级用户
高級總監
Credits 65
Posts 27
Joined 2007-06-20 16:50
19-year member
UID 91895
Gender Male
From china
Status Offline
走過路過,千萬別錯過。
Forum Jump: