aabout2008 当前在线
列兵
@echo off set folder_path=%~dp0 set output_file=%~dp0\Output.txt dir /b "%folder_path%\*" > "%output_file%" pause复制代码
TOP
77七 当前离线
中校
@echo off rem 保存为ansi编码 cd /d "%~dp0" set "oldstr=a" set "newstr=b" for /f "delims=" %%i in ('dir /b /a-d') do ( if "%%i" neq "%~nx0" ( set n=%%~ni if defined n ( call ren "%%i" "%%n:%oldstr%=%newstr%%%%%~xi" ) ) ) pause复制代码
77七 发表于 2024-11-21 12:50
qixiaobin0715 当前在线
大校
aloha20200628 当前离线
上尉
@echo off &chcp 936>nul set "s1=自行车" &set "s2=坦克车" for /f "delims=" %%F in ('dir /b/a-d *%s1%*') do ( set "F=%%~nF" &setlocal enabledelayedexpansion (ren "%%F" "!F:%s1%=%s2%!%%~xF") &endlocal) pause&exit/b复制代码
@echo off &chcp 65001>nul set "s1=自行车" &set "s2=坦克车" for /f "delims=" %%F in ('dir /b/a-d *%s1%*') do ( set "F=%%~nF" &setlocal enabledelayedexpansion (ren "%%F" "!F:%s1%=%s2%!%%~xF") &endlocal) pause&exit/b复制代码