标题: [日期时间] [已解决]批处理怎么把最后解密的明文输出到比如c:\100.txt [打印本页]
作者: 906053584 时间: 2015-9-6 22:06 标题: [已解决]批处理怎么把最后解密的明文输出到比如c:\100.txt
- @echo off&setlocal enabledelayedexpansion
- rem 生成方阵
- 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"
- set "code=%codes: =%"
- for %%i in (%codes%) do set /a n+=1&set "_!n!=%%i"
- set "_a=%code%"
- for /l %%i in (1,1,25) do (
- set "code=!code:~1!!code:~,1!"
- set "_!code:~,1!=!code!"
- )
- echo.&set /p str=请输入密文:
- echo.&set /p pss=请输入密匙:
- echo.&set /p=解密的明文:<nul
- :again
- set "a1=%str:~,1%"&set "a2=%pss:~,1%"
- set "str=%str:~1%"&set "pss=%pss:~1%%a2%"
- set "var=!_%a2%!"&set "n=0"&call :lp
- if defined str goto again
- pause>nul&goto :eof
- :lp
- set "a=%var:~,1%"&set /a n+=1
- if /i "%a%" equ "%a1%" set /p=!_%n%!<nul&goto :eof
- set "var=%var:~1%"
- 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 |