![]() |
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-08-07 22:34 |
48,041 topics / 350,128 posts / today 3 new / 48,252 members |
| DOS批处理 & 脚本技术(批处理室) » Enter password to start the program (password can be changed) |
| Printable Version 1,878 / 13 |
| Floor1 ZJHJ | Posted 2007-03-04 03:21 |
| 高级用户 Posts 374 Credits 609 | |
|
I read the posts related to this, and it seems too complicated. I wrote a try. (If you think it's okay, please support it)
@echo off if exist M.RQM goto bn rem llts in 0070303schj by q@251485609 @echo 12345678>M.RQM :bn @cls @echo off @echo. @echo. @echo. @echo To ensure the security of user settings, this program requires administrator privileges to enter and operate! @echo. @echo. @echo Enter T to exit @echo. @echo ------- * -------- * -------- @echo. @echo Initial password: 12345678 @echo. SET /P SY= Please enter the administrator password: FOR /F %%I IN (M.RQM) DO SET syq=%%I IF "%SY%" == "%syq%" GOTO kyjr IF "%SY%" == "CK" GOTO ckmm IF "%SY%" == "T" GOTO :eof @cls @echo. @echo. @echo. @echo Sorry, (the password may have been changed) you are not an administrator and cannot enter and operate! pause>nul @goto bn :kyjr @cls @echo. SET /P SYg= Please press any key to enter the program (if you need to change the original password, please enter XGMM): IF "%SYg%" == "XGMM" GOTO xg IF not "%SYg%" == "XGMM" goto k :xg @cls SET /P xmm= Please enter the new password: @echo %xmm%>xmm.txt SET /P cxmm= Please enter again: FOR /F %%I IN (xmm.txt) DO SET xsyq=%%I IF "%cxmm%" == "%xsyq%" GOTO gng @echo Password does not match! pause goto xg :gng COPY xmm.txt M.RQM @echo Password changed successfully! Please remember this password. pause>nul goto bn :ckmm @cls FOR /F %%I IN (M.RQM) DO SET syq=%%I @echo %syq% pause>nul goto bn :k del xmm.txt @cls @echo Enter the usage program pause>nul |
|
| Floor2 Kinglion | Posted 2007-03-04 05:45 |
| 铂金会员 Posts 1,924 Credits 5,798 From 金獅電腦軟體工作室 | |
|
If you simply use batch processing without handling CTRL + C, it is very easy to be aborted. So I think it is also necessary to cooperate with some applications to control the keyboard to achieve the purpose that batch processing cannot be aborted during execution.
|
|
| Floor3 6622186 | Posted 2007-03-05 13:17 |
| 高级用户 Posts 411 Credits 894 | |
| Floor4 zhoushijay | Posted 2007-03-06 02:01 |
| 高级用户 Posts 375 Credits 845 | |
|
Sweat, the file that saves the password can actually be opened with TXT. It's just that the TXT suffix was changed. Can it be changed to garbled code?
|
|
| Floor5 ZJHJ | Posted 2007-03-06 10:29 |
| 高级用户 Posts 374 Credits 609 | |
|
This method mainly doesn't want others to enable your program and destroy your own settings. This is just one method. As for the place and way to save the password, you can use your own brains.
|
|
| Floor6 oumiga | Posted 2007-03-18 13:58 |
| 初级用户 Posts 22 Credits 154 | |
| Floor7 weizhengguo | Posted 2007-08-03 15:52 |
| 初级用户 Posts 8 Credits 20 | |
|
I don't have high requirements for password security, and this program is exactly what I need. Thanks a lot to the original poster.
|
|
| Floor8 weizhengguo | Posted 2007-08-03 17:01 |
| 初级用户 Posts 8 Credits 20 | |
|
There seems to be some issues with the code. After modifying the password, when entering the password for the second time and pressing Enter, it goes back to the password modification instead of entering the execution program.
|
|
| Floor9 ZJHJ | Posted 2007-08-03 21:38 |
| 高级用户 Posts 374 Credits 609 | |
|
Because you didn't restart the program, the previous variables remain in the machine.
|
|
| Floor10 yk520 | Posted 2008-03-21 12:23 |
| 初级用户 Posts 17 Credits 24 | |
| Floor11 zcnvnv | Posted 2008-03-21 20:24 |
| 初级用户 Posts 36 Credits 114 | |
|
Just add some encryption casually, then output it.
|
|
| Floor12 bowen666 | Posted 2008-03-24 18:57 |
| 初级用户 Posts 9 Credits 22 | |
|
@echo off
color 0a MODE con: COLS=50 LINES=27 set ci=3 echo. echo Notice: Three incorrect inputs will exit. Don't enter if you don't know the password~~ echo. :1 set /p mima=Please enter the password: if "%mima%"=="123" goto o set /a ci-=1 if "%ci%"=="0" cls&echo.&echo ====No password and still want to come in!!!====No way!!!====&echo.&pause&echo.&exit cls&echo.&echo You have %ci% chances left&echo.&goto 1 :o cls&echo. echo ============ Password correct, access granted ============ |
|
| Floor13 bowen666 | Posted 2008-03-24 18:58 |
| 初级用户 Posts 9 Credits 22 | |
|
The password upstairs is of course displayed in plain text inside. On the one hand, this can be encrypted, and on the other hand, it will be very convenient for people who have low requirements for passwords.
|
|
| Floor14 knoppix7 | Posted 2008-03-24 22:32 |
| 银牌会员 Posts 634 Credits 1,287 From cmd.exe | |
|
Directly CTRL+C..
Use the automatic run in cmd, I just cmd /d |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |