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-08-04 06:45
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to make a batch file in DOS under Win98 continue only after entering a password? View 697 Replies 1
Original Poster Posted 2007-04-19 09:48 ·  中国 广东 佛山 电信
新手上路
Credits 15
Posts 7
Joined 2007-04-18 08:58
19-year member
UID 85603
Gender Male
Status Offline
There is a program that needs to run in DOS under Win98. To prevent accidental operation, I want to design password protection so that it asks for a password while running. The program I wrote runs fine in DOS6.22 and DOS under WinXP, but in DOS under Win98, DOS under WinME, and DOS7.1, it still cannot pass. This program needs to run in DOS under Win98, because it has to access a FAT32 disk while running. Part of the code is as follows:

In DOS6.22:

set get=
get s "Please enter password:"
if "%get%" == "123456" goto RUN
goto EXIT

:RUN
(omitted)

:EXIT
echo The password you entered is incorrect. Press any key to exit!
pause >NUL


In WinXP:

set /p a=Please enter password:
if %a% == 123456 goto RUN
goto EXIT

:RUN
(omitted)

:EXIT
echo The password you entered is incorrect. Press any key to exit!
pause >NUL



Question: how can this be done in DOS under Win98?

[ Last edited by HYQ9 on 2007-4-18 at 08:50 PM ]
Floor 2 Posted 2007-04-21 21:45 ·  中国 河南 郑州 联通
新手上路
Credits 15
Posts 7
Joined 2007-04-18 08:58
19-year member
UID 85603
Gender Male
Status Offline
No one can help me?:(
Forum Jump: