本帖最后由 terse 于 2015-8-14 22:45 编辑
是纯DOS吗 顺便修正一个变量名- @if(0)==(0) echo off
- for /f "delims=" %%i in ('dir /a-d/b ^|findstr /ixv "%~nx0" ^|cscript.exe -NoLogo -E:JScript %0') do (
- echo Ren %%i 2>nul
- )
- pause & exit
- @end
- var s = "000"
- while (!WSH.StdIn.AtEndOfStream){
- var str = WScript.StdIn.ReadLine();
- var newstr = str.replace
- (/(.+?\()(\d+)(\).+)/,
- function(a,b,c,d) {
- return('"' + a + '" '+ '"' + b + s.substring(0, 3 - c.length) + c + d + '"');
- }
- );
- if (newstr != str) WSH.Echo(newstr);
- }
复制代码
|