|
本帖最后由 不知 于 2016-11-8 19:46 编辑
从echo到%pass%是一条命令,用chenall大元帅的代码吧,简洁多了。
现在其实是这样的:在分区根目录放一文件pass存放密码。
初始密码:
123456
pass内容:
$1$2ei2$Bm7jo8/I0tIbu6B8vsPIW
菜单代码:
find /pass | set pwroot=
cat %pwroot%/pass | set pass=
password --md5 %pass%
timeout 0
default 0
title boot
echo -n Verify Password:
if "%pass%"=="" echo no password
if not "%pass%"=="" password --md5 %pass%
find --set-root /bootmgr && chainloader /bootmgr
find --set-root /ntldr && chainloader /ntldr
title change password
echo -n Verify Password:
if "%pass%"=="" echo no password
if not "%pass%"=="" password --md5 %pass%
set /p newpw=Input New Password:
if "%newpw%"=="" echo > %pwroot%/pass && exit
if not "%newpw%"=="" md5crypt %newpw% | set newpw=
set newpw=%newpw:~11%
set /p newpwd=Input New Password Again:
md5crypt %newpwd% | set newpwd=
set newpwd=%newpwd:~11%
if %newpw%==%newpwd% echo -n %newpwd% > %pwroot%/pass
if not %newpw%==%newpwd% echo change password failed,please try again,press enter to exit && set /p pause=
|
|