@echo off cd/d "%~dp0" echo 欢迎使用最终《不可回头》工具 echo. echo. set tmpPassFile=%temp%\tmp_inputpass.txt set tmpSecretFile=%temp%\tmp_secret.txt set tmpdecodeFile=%temp%\tmp_passdecode.txt set final_secret="1c 73 16 af d4 8a 5b 9e 8b ad c8 84 3f d9 f6 5d" :pass1 set /p p1="请输入第一条口令: " set /p p2="请输入第二条口令: " set /p p3="请输入第三条口令: " ::输入的口令加密 :: 以下这种写法一定要保留 :: 因为echo写入文件时默认添加换行符 :: 查询到的信息中,这是最好用的解决方案 set /p=%p1%%p2%%p3%%tmpPassFile% if exist %tmpSecretFile% ( del %tmpSecretFile% ) certutil -hashfile %tmpPassFile% MD5 > %tmpSecretFile% ::本来打算使用Base64的 ::certutil -decode %tmpSecretFile% %tmpdecodeFile% for /f "skip=1 delims=" %%a in (%tmpSecretFile%) do ( set txt="%%~a" goto :getMD5 ) :getMD5 set md5=%txt% echo %md5% if /i %md5% == %final_secret% ( echo 通过验证! if exist %tmpPassFile% ( del %tmpPassFile% ) if exist %tmpSecretFile% ( del %tmpSecretFile% ) if exist %tmpdecodeFile% ( del %tmpdecodeFile% ) goto main ) else ( echo 验证失败,按任意键退出 pause > nul exit ) :main echo 接下来即将执行危险操作,此时方可回头,一但继续将不可挽回!!! set /p answer="是否继续?(y/n): " if /i "%answer%"=="y" goto DoIt if /i "%answer%"=="n" goto Finish :Finish echo 操作已取消,按任意键退出 pause > nul exit ::以下做删除操作 :DoIt echo 一曲张学友的《回头太难》送给你!! echo 正在删除...... echo. ::========================= @echo on :: Here todo sth. del /f %temp%\*.tmp @echo off ::========================= echo ============= END ============= echo. echo 删除完成,按任意键退出 pause > nul