![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-10-26 19:06 |
47,815 topics / 349,928 posts / today 0 new / 48,288 members |
| DOS启动盘 & LOGO技术 (启动盘室) » How to write a password login program in autoexec.bat? |
| Printable Version 1,100 / 6 |
| Floor1 susan2003 | Posted 2003-10-17 00:00 |
| 初级用户 Posts 7 Credits 121 | |
|
How can I make it so that in autoexec.bat, under dos mode, a password must be entered and cannot be skipped, and only after the password is confirmed can it enter dos; otherwise it will keep prompting for the correct password? Please help.
|
|
| Floor2 susan2003 | Posted 2003-10-17 00:00 |
| 初级用户 Posts 7 Credits 121 | |
|
How do you write it?
|
|
| Floor3 Roy | Posted 2003-10-17 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
The following is quoted from susan2003's post at 2003-10-17 22:18:04:Putting a "login" in autoexec.bat ........... the security is not enough....... setting a password in the BIOS is more practical |
|
| Floor4 susan2003 | Posted 2003-10-18 00:00 |
| 初级用户 Posts 7 Credits 121 | |
|
Yes, but please go ahead and write that program, I already know about BIOS, thanks.
|
|
| Floor5 Roy | Posted 2003-10-18 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
|
:: --------------------------------------------------------------
:: Author: Leonardo Pignataro ([email protected]) :: -------------------------------------------------------------- :: Usage: Request an alpha-numeric password request (letters :: and numbers only). Displays asterisks instead of :: typed characters. The input method used will convert :: all leters to lowercase, so the password will be case :: insensitive. If user inputs the right password, the :: label :granted will be invoked. Otherwise, the label :: :denied will be invoked. Setup real password below. :: -------------------------------------------------------------- :: * Disabled CTRL+C (CTRL+BREAK still works) :: -------------------------------------------------------------- @echo off :: -------------------------------------------------------------- :: SCRIPT SETUP :: -------------------------------------------------------------- :: Set password (the right one, which grats access) below. :: Use letters in LOWERCASE ONLY, otherwise access will never be :: granted. :: -------------------------------------------------------------- REM Your password and password length (shown as *) REM Note: the password must be lowercase letters or numbers SET REAL_PASS=mypass SET REAL_LENGTH=****** :: -------------------------------------------------------------- :: The REAL_LENGTH variable must have the same length as :: REAL_PASS, but must be made of asterisks only. :: -------------------------------------------------------------- REM Create the checking program :: Thanks to Laurence Soucy for the following assembler code echo e100 B4 00 CD 16 88 E0 B4 4C CD 21> %temp%.\scan.com for %%? in (rcx A w q) do echo %%?>> %temp%.\scan.com type %temp%.\scan.com |DEBUG %temp%.\scan.com > nul REM Initial setup :pre for %%? in (pass length) do set user_%%?= REM Check password :loop set input= cls echo Type password: %user_length% if "%user_pass%"=="%real_pass%" goto granted if "%user_length%"=="%real_length%" goto denied call %temp%.\scan.com if errorlevel=2 if not errorlevel=3 set input=1 if errorlevel=3 if not errorlevel=4 set input=2 if errorlevel=4 if not errorlevel=5 set input=3 if errorlevel=5 if not errorlevel=6 set input=4 if errorlevel=6 if not errorlevel=7 set input=5 if errorlevel=7 if not errorlevel=8 set input=6 if errorlevel=8 if not errorlevel=9 set input=7 if errorlevel=9 if not errorlevel=10 set input=8 if errorlevel=10 if not errorlevel=11 set input=9 if errorlevel=11 if not errorlevel=12 set input=0 if errorlevel=30 if not errorlevel=31 set input=a if errorlevel=48 if not errorlevel=49 set input=b if errorlevel=46 if not errorlevel=47 set input=c if errorlevel=32 if not errorlevel=33 set input=d if errorlevel=18 if not errorlevel=19 set input=e if errorlevel=33 if not errorlevel=34 set input=f if errorlevel=34 if not errorlevel=35 set input=g if errorlevel=35 if not errorlevel=36 set input=h if errorlevel=23 if not errorlevel=24 set input=i if errorlevel=36 if not errorlevel=37 set input=j if errorlevel=37 if not errorlevel=38 set input=k if errorlevel=38 if not errorlevel=39 set input=l if errorlevel=50 if not errorlevel=51 set input=m if errorlevel=49 if not errorlevel=50 set input=n if errorlevel=24 if not errorlevel=25 set input=o if errorlevel=25 if not errorlevel=26 set input=p if errorlevel=16 if not errorlevel=17 set input=q if errorlevel=19 if not errorlevel=20 set input=r if errorlevel=31 if not errorlevel=32 set input=s if errorlevel=20 if not errorlevel=21 set input=t if errorlevel=22 if not errorlevel=23 set input=u if errorlevel=47 if not errorlevel=48 set input=v if errorlevel=17 if not errorlevel=18 set input=w if errorlevel=45 if not errorlevel=46 set input=x if errorlevel=21 if not errorlevel=22 set input=y if errorlevel=44 if not errorlevel=45 set input=z if errorlevel=71 if not errorlevel=72 set input=7 if errorlevel=72 if not errorlevel=73 set input=8 if errorlevel=73 if not errorlevel=74 set input=9 if errorlevel=75 if not errorlevel=76 set input=4 if errorlevel=76 if not errorlevel=77 set input=5 if errorlevel=77 if not errorlevel=78 set input=6 if errorlevel=79 if not errorlevel=80 set input=1 if errorlevel=80 if not errorlevel=81 set input=2 if errorlevel=81 if not errorlevel=82 set input=3 if errorlevel=82 if not errorlevel=83 set input=0 if "%input%"=="" goto loop set user_length=*%user_length% set user_pass=%user_pass%%input% goto loop REM Password correct :granted echo Access granted. goto pass_end REM Password incorrect :denied echo Access denied. GOTO PRE REM "Login" complete :pass_end for %%? in (pass length) do set user_%%?= for %%? in (pass length) do set real_%%?= del %temp%.\scan.com REM The command below is run after "login" |
|
| Floor6 susan2003 | Posted 2003-10-18 00:00 |
| 初级用户 Posts 7 Credits 121 | |
|
Thank you so much, you are my idol!!!!
|
|
| Floor7 柳五 | Posted 2003-10-18 00:00 |
| 初级用户 Posts 31 Credits 184 | |
|
If you skip executing autoexec.bat, is this password still of any use?
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |