[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set "pwd=ad654bc321" &set "_pwd=!pwd!"
  4. for %%n in (0,1,2,3,4,5,6,7,8,9) do set "_pwd=!_pwd:%%n=,!"
  5. for %%s in (!_pwd!) do set "pwd=!pwd:%%s=!"
  6. echo,!pwd!
  7. endlocal&exit/b
复制代码
1

评分人数

    • 77七: 感谢分享技术 + 1

TOP


订正5楼代码》改为纯P的“递归”结构应该就可以了...

  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set "pwd=b654bc321"
  4. :[Loop]
  5. set "_pwd=!pwd!"
  6. set "pwd_=!pwd!"
  7. for %%n in (0,1,2,3,4,5,6,7,8,9) do set "_pwd=!_pwd:%%n=,!"
  8. echo,!_pwd!
  9. for %%s in (!_pwd!) do set "pwd=!pwd:%%s=!"
  10. if "!pwd!"=="!pwd_!" (goto[end]) else (goto[Loop])
  11. :[end]
  12. echo,!pwd!
  13. endlocal&exit/b
复制代码

TOP

返回列表