[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 1# lj670
  1. @echo off
  2. :start
  3. cd /d "%~dp0"
  4. set /a "fx=0"
  5. set "OutFile=11 (%fx%) .txt"
  6. if exist "11 (0) .txt" set /a "fx=%fx%+1"
  7. echo %fx%
  8. (for /f "delims=" %%i in ('dir /b /a-d *.*') do (
  9.     if "%%i" neq "%OutFile%" (
  10.         echo,%%~ni
  11.     ) else if "%fx%"=="0" (
  12.        set "OutFile=11.txt"
  13. ))>"%OutFile%"
  14. )
  15. pause
  16. goto :start
复制代码
1

评分人数

QQ 1980286392

TOP

回复 2# BingjianREMIX


    一些不对
  1. @echo off
  2. :start
  3. cd /d "%~dp0"
  4. set /a "fx=0"
  5. set "OutFile=11 (%fx%) .txt"
  6. if exist "11 (0) .txt" set /a "fx=%fx%+1"
  7. (for /f "delims=" %%i in ('dir /b /a-d *.*') do (
  8.     if "%%i" neq "%OutFile%" (
  9.         echo,%%~ni
  10.     )
  11. )
  12. if "%fx%" equ "0" (
  13.        set "OutFile=11.txt"
  14. )
  15. )>"%OutFile%"
  16. pause
  17. goto :start
复制代码
1

评分人数

QQ 1980286392

TOP

本帖最后由 BingjianREMIX 于 2023-7-8 17:49 编辑

回复 4# lj670
  1. @echo off
  2. cd /d "%~dp0"
  3. if not exist 11.txt (
  4.     set /a "fx=0"
  5. )
  6. if exist "11.txt" (
  7.    set /a "fx=0"
  8.    set /a "b=1"
  9.    set /a "fx=%fx%+1"
  10.    set "OutFile=11 (%fx%) .txt"
  11. )
  12. if "%fx%" equ "0" (
  13.        set "OutFile=11.txt"
  14. )
  15. :1
  16. (for /f "delims=" %%i in ('dir /b /a-d *.*') do (
  17.     if "%%i" neq "%OutFile%" (
  18.         echo,%%~ni
  19.     )
  20. ))>"%OutFile%"
  21. if exist "11 (0) .txt" (
  22.    ren "11 (0) .txt" "11 (1) .txt"
  23. )
复制代码
1

评分人数

    • lj670: 感谢感谢技术 + 1
QQ 1980286392

TOP

回复 5# BingjianREMIX


    连用即可
QQ 1980286392

TOP

回复 7# lj670


    丢到terminal里连用,或者代码开头加个:start,结尾加个pause和goto
QQ 1980286392

TOP

返回列表