以前写的枚举输入字符组合的方法(注意非空字符不要超过9个):- @echo off&setlocal enabledelayedexpansion
- set /p num=请输入字符:
- set "num=%num: =%"&set "num=!num: =!"
- set "s=abcdefghijklnmopqrstuvwxyz"
- :lp
- set /a n+=1
- set "ss=%ss%str%n%"&set "k=%k%)"&set "str1=%str1% %n%"
- set "nums=%nums% %num:~,1%"&set "num=%num:~1%
- if defined num goto lp
- (echo ^@echo off^&setlocal enabledelayedexpansion
- echo cd.^>list.txt
- echo for %%%%a in ^(%nums%^) do set /a m+=1^&set "_^!m^!=%%%%a"
- echo set "str1=%str1%")>temp.bat
- for /l %%a in (1,1,%n%) do (
- set "a=%%%%!s:~,1!"&set "b=!ss:~,4!"&set "c=!ss:~4,4!"
- set "str=!str!^!_!a!^!"&if "!c!" equ "" set "c=flag"
- echo for !a! in ^(^^^!!b!^^^!^) do ^(set "!c!=^!!b!:!a!=^!">>temp.bat
- set "s=!s:~1!"&set "ss=!ss:~4!"
- )
- echo echo !str!^>^>list.txt>>temp.bat
- echo %k%>>temp.bat
- echo start list.txt^&del /q %%0>>temp.bat
- endlocal&temp.bat
复制代码
[ 本帖最后由 batman 于 2009-11-13 18:03 编辑 ] |