Board logo

标题: [日期时间] [已解决]批处理怎么把最后解密的明文输出到比如c:\100.txt [打印本页]

作者: 906053584    时间: 2015-9-6 22:06     标题: [已解决]批处理怎么把最后解密的明文输出到比如c:\100.txt

  1. @echo off&setlocal enabledelayedexpansion
  2. rem 生成方阵
  3. set "codes=a b c d e f g h i j k l m n o p q r s t u v w x y z"
  4. set "code=%codes: =%"
  5. for %%i in (%codes%) do set /a n+=1&set "_!n!=%%i"
  6. set "_a=%code%"
  7. for /l %%i in (1,1,25) do (
  8.     set "code=!code:~1!!code:~,1!"
  9.     set  "_!code:~,1!=!code!"
  10. )
  11. echo.&set /p str=请输入密文:
  12. echo.&set /p pss=请输入密匙:
  13. echo.&set /p=解密的明文:<nul
  14. :again
  15. set "a1=%str:~,1%"&set "a2=%pss:~,1%"
  16. set "str=%str:~1%"&set "pss=%pss:~1%%a2%"
  17. set "var=!_%a2%!"&set "n=0"&call :lp
  18. if defined str goto again
  19. pause>nul&goto :eof
  20. :lp
  21. set "a=%var:~,1%"&set /a n+=1
  22. if /i "%a%" equ "%a1%" set /p=!_%n%!<nul&goto :eof
  23. set "var=%var:~1%"
  24. goto lp
复制代码

作者: pcl_test    时间: 2015-9-6 22:22

本帖最后由 pcl_test 于 2015-9-6 22:23 编辑

if /i "%a%" equ "%a1%" set /p=!_%n%!<nul>>"C:\明文.txt"&goto :eof




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2