保存为ansi或gbk或gb2312编码的bat- @set @l_l=1;/*&echo off
- for /f "eol=/ tokens=1* delims=/" %%a in ('dir /b /ad^|cscript //e:jscript //nologo "%~f0"') do (
- if "%%b" neq "%nil%" rename "%%a" "%%b"
- )
- echo,done&pause&exit /b 0 */
-
- Array.prototype.each=function(block){for(var i=0;i<this.length;i++)block(this[i]);return this;};
- WScript.StdIn.ReadAll().split(/\r?\n/).each(function(str){
- var aaa=str.match(/[^ ]+ +/g);
- if(aaa)aaa.pop();
- if(aaa&&aaa.length){WScript.Echo(str+'/'+aaa.join('').replace(/ +$/,''))}else{WScript.Echo(str);
- }});
复制代码
|