- @echo off
- color 1f&mode con cols=50 lines=3
- :kaishi
- cls
- if exist 1.sys (goto ok)
- set /p a1=请设置密码:
- if not defined a1 (goto nc)
- set /p a2=请再次输入:
- if not defined a2 (goto nc)
- if %a1% neq %a2% goto bu
- echo %a2% >1.sys
- attrib 1.sys +s +h
- cls
- echo 恭喜你,密码设置成功;
- pause>nul
- goto kaishi
- :ok
- cls
- set /P a3=请输入密码:
- for /f %%i in (1.sys) do set a4=%%i
- if "%a3%"=="%a4%" goto zhengque
- goto err
- pause>nul
-
- :zhengque
- cls
- echo 输入正确,你现在可以开始使用本程序了;
- set /p a5=请选择:“1”删除密码“2”使用本程序“3”退出程序
- if "%a5%"=="1" goto shanchu
- if "%a5%"=="2" goto shiyong
- if "%a5%"=="3" goto tuichu
- cls
- echo 无效操作;
- pause>nul
- goto zhengque
-
- :shiyong
- cls
- echo 程序使用完毕,现在退出;
- pause>nul
- :tuichu
- exit
-
- :nc
- cls
- echo 你没有输入任何字符,按任意键重新输入;
- pause
- goto kaishi
-
- :bu
- cls
- echo 你两次输入不一致,请重新输入;
- pause
- goto kaishi
-
- :err
- cls
- echo 你输入的密码错误,请重新输入;
- pause
- goto kaishi
-
- :shanchu
- cls
- del 1.sys /s /q /f /ah /as >nul
- echo 密码清除成功,按任意键可以重新设置密码;
- pause>nul
- goto kaishi
复制代码
|