将上面文本保存为列表.txt放入需要处理的文件夹.- /*&cls
- @echo off
- setlocal EnableDelayedExpansion
- for /f "delims=" %%a in ('type 列表.txt^|cscript -nologo -e:jscript "%~f0"') do (
- ren %%a
- )
- pause&exit
- */
-
- var t='', map={}, files = WScript.StdIn.ReadAll().split('\r\n');
- for (var i=0; i<files.length; i++){
- var str = files[i].replace(/(.+)→(.+)$/,'"$1" "$2"')
- if(!map[str]){map[str] = true;t+=str+'\r\n';}
- }
- WSH.echo(t);
复制代码 根据时间先后顺序排列+1重命名jpeg- @echo off&setlocal enabledelayedexpansion
- set a=1
- for /f "delims=" %%a in ('dir /b/a-d/oD *.jpeg') do (
- ren %%~nxa !a!_%%~nxa
- set/a a+=1
- )
- pause
复制代码 第一个如果内容整行的就是文件夹名称,下载ren2执行复制代码 或- @echo off
- for /f "tokens=1-2 delims=→" %%a in ('dir /ad /o-d /b "*"') do ren "%%a→%%b" "%%b"
- pause
复制代码
|