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-29 10:08
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » With everyone's effort, batch files can say goodbye to choice DigestI View 15,157 Replies 45
Floor 31 Posted 2008-12-11 13:33 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
Could you give an example?
Floor 32 Posted 2008-12-11 14:13 ·  中国 北京 联通
银牌会员
★★★
Credits 2,098
Posts 566
Joined 2007-09-11 07:27
18-year member
UID 97070
Gender Male
Status Offline
Originally posted by wangff at 2008-12-11 01:33 PM:
Could you give an example?

choice /?
Floor 33 Posted 2008-12-11 14:20 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
This is how I understand it:
1.As for keyboard input, choice is ultimately implemented with the two basic functions ah=0 and ah=1
2.No matter how good choice is, not every system has it preinstalled (my XP doesn't)
3.No matter how powerful choice is, its functions are fixed, while if p has these two basic functions, everything else can be left to everyone's imagination. Which is better, fish or a fishing rod, everyone understands
4.Making a farewell to choice our goal, let everyone work on it together

[ Last edited by wangff on 2008-12-11 at 15:11 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
HAT +2 2008-12-11 17:48
Floor 34 Posted 2008-12-11 18:19 ·  中国 广西 玉林 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
This way you don't need so many jumps
...
ping -n 2 127.1>nul
if %n% LEQ 5 goto loop

echo.
echo Time's up, run automatically!
pause
Floor 35 Posted 2008-12-11 18:33 ·  中国 山西 电信
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
“Everyone understands whether fish is better or the fishing rod is better”
I believe there are only a few who really understand
After all, compared with fish
a fishing rod still needs a pool of water and some bait

If you really want to say the fishing rod is better
then ask which is better, a fishing rod or a stick + line + hook?
And which is better, fish or braised carp?
How should one choose then

Don't forget that debug is a very troublesome thing in cmd
Using it will bring many potential problems (not just code pages)
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
wangff +2 2008-12-11 19:15
Floor 36 Posted 2008-12-11 19:29 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
What the poster on the 35th floor said makes sense, but:
"Don't forget that debug is a very troublesome thing in cmd
Using it will bring many potential problems (not just code pages)"

I really don't know about that. Could you tell me a thing or two? If it's fatal then I'll give up this idea. Since debug makes it feasible to embed small assembly in p, I think it's quite important.

[ Last edited by wangff on 2008-12-11 at 19:32 ]
Floor 37 Posted 2008-12-12 09:27 ·  中国 山西 电信
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
For the general situation, you can refer to the following threads
http://www.cn-dos.net/forum/viewthread.php?tid=9452
http://www.cn-dos.net/forum/viewthread.php?tid=20682

What is currently known is
using Debug inevitably requires enabling ntvdm
and that is a command-line environment very different from cmd
for example command-line auto-completion
for example long and short filenames
Floor 38 Posted 2008-12-12 12:49 ·  中国 福建 三明 电信
中级用户
★★
Credits 458
Posts 211
Joined 2006-07-26 19:42
19-year member
UID 59307
Status Offline
There's another problem: this choice cannot pause and wait for input (maybe this is what brother qzwqzw in the post above meant by "command-line auto-completion"), but instead keeps looping inside the :loop label.
┌───────┐
├→学习→实践→┤
└───────┘
Floor 39 Posted 2008-12-12 14:21 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
The issue on the 37th floor is being checked...
The issue on the 38th floor should not exist. Could it be that it was run without parameters? Which post's program was it?
Floor 40 Posted 2008-12-12 14:34 ·  中国 福建 三明 电信
中级用户
★★
Credits 458
Posts 211
Joined 2006-07-26 19:42
19-year member
UID 59307
Status Offline
I didn't read carefully. Turns out the 27th floor already has the parameter-based pause function.

There's another problem (environment XP SP3)
During dynamic detection, if certain keys are pressed (such as Ctrl), it will then pseudo-hang, meaning pressing anything afterward gets no response.
Pressing several letters quickly can also cause the above situation.
Not sure whether this also happens when run with parameters?
┌───────┐
├→学习→实践→┤
└───────┘
Floor 41 Posted 2008-12-12 15:03 ·  中国 福建 泉州 移动
初级用户
★★
Credits 134
Posts 54
Joined 2008-11-19 11:47
17-year member
UID 131429
Gender Male
Status Offline
The "pseudo-hang" phenomenon does happen, still looking for the cause...
But it should be unrelated to debug, inc.com does it too.
Floor 42 Posted 2008-12-13 03:18 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 2,098
Posts 566
Joined 2007-09-11 07:27
18-year member
UID 97070
Gender Male
Status Offline
Wrote a piece of code that can return ascii:

>i.com echo h#CX-~AP3/1/h$CX-}AP3/1/h'CX-~AP3/1/h#CX-xAP3/1/uK
i
echo %errorlevel%
Floor 43 Posted 2008-12-13 18:24 ·  中国 福建 泉州 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
All experts here. I can't understand it, so I'll save it for future use.
QQ:366840202
http://chenall.net
Floor 44 Posted 2008-12-17 21:53 ·  中国 四川 成都 电信
新手上路
Credits 3
Posts 3
Joined 2007-10-20 19:40
18-year member
UID 100283
Gender Male
Status Offline
But it still relied on assembly.
Floor 45 Posted 2009-01-15 19:09 ·  中国 广东 广州 电信
新手上路
Credits 6
Posts 5
Joined 2008-05-01 10:16
18-year member
UID 117451
Gender Male
Status Offline
@echo off
echo h#CX-~AP3/1/h$CX-}AP3/1/h'CX-~AP3/1/h#CX-xAP3/1/uK>key.com
chcp 437>nul&graftabl 936>nul
color 2f
:1
cls
echo Please enter password:%es%
key
set pk=%errorlevel%
set tmp=
if %pk%==13 goto t1
if %pk%==8 goto backspace
if %pk%==97 set tmp=a
if %pk%==98 set tmp=b
if %pk%==99 set tmp=c
if %pk%==100 set tmp=d
if %pk%==101 set tmp=e
if %pk%==102 set tmp=f
if %pk%==103 set tmp=g
if %pk%==104 set tmp=h
if %pk%==105 set tmp=i
if %pk%==106 set tmp=j
if %pk%==107 set tmp=k
if %pk%==108 set tmp=l
if %pk%==109 set tmp=m
if %pk%==110 set tmp=n
if %pk%==111 set tmp=o
if %pk%==112 set tmp=p
if %pk%==113 set tmp=q
if %pk%==114 set tmp=r
if %pk%==115 set tmp=s
if %pk%==116 set tmp=t
if %pk%==117 set tmp=u
if %pk%==118 set tmp=v
if %pk%==119 set tmp=w
if %pk%==120 set tmp=x
if %pk%==121 set tmp=y
if %pk%==122 set tmp=z
if %pk%==48 set tmp=0
if %pk%==49 set tmp=1
if %pk%==50 set tmp=2
if %pk%==51 set tmp=3
if %pk%==52 set tmp=4
if %pk%==53 set tmp=5
if %pk%==54 set tmp=6
if %pk%==55 set tmp=7
if %pk%==56 set tmp=8
if %pk%==59 set tmp=9
if %tmp%== goto 1
set es=%es%*
set ep=%ep%%tmp%
goto 1
:backspace
if "%ep%"=="" goto 1
set ep=%ep:~0,-1%
set es=%es:~0,-1%
goto 1
:t1
echo Your password is: %ep%
pause
Forum Jump: