回复 1# ZeronoFreya
这样试下呢?
无64位环境测试 请自行备份数据- @if(0)==(0) echo off
- set "Sysdir=SysWOW64"
- if /i "%PROCESSOR_ARCHITECTURE%" == "x86" if not defined PROCESSOR_ARCHITEW6432 set "Sysdir=System32"
- set cscript="%Windir%\%Sysdir%\cscript.exe" //nologo //e:javascript
- if "%~1" == "" (set "ph=%~dp0") else set "ph=%~1\"
- for /f "delims=" %%i in ('dir/b/s "%ph%*[*]*.txt"^|%cscript% "%~f0"')do (
- echo,Ren %%i 2>nul
- )
- pause
- goto :eof
- @end
- while (!WScript.StdIn.AtEndOfStream) {
- var f = WScript.StdIn.ReadLine()
- var arr = f.match(/(\[(\d{2})\])/)
- if (arr) WScript.echo('"' + f + '"','"' + arr[2] + '.txt"');
- }
复制代码
|