- @if (0) == (0) echo off
- set n=20
- for /f "delims=" %%i in ('dir /b *次-*.txt ^|cscript -nologo -e:jscript "%~f0" "%n%"') do set "file=%%i"
- echo copy "%file%" "c:\"
- pause&exit/b
- @end;
- var re = /^(\d+).*/mg;
- WScript.Echo(filesort(WScript.StdIn.ReadAll(),WScript.Arguments.Item(0)));
- function filesort(s,n) {
- arr = s.replace(re, function($0,$1) {return $1 + " " + $0;});
- arr = arr.split("\n");
- arr.sort(sortNumber);
- return arr[n].replace(/^\d+ /mg, "");
- };
- function sortNumber(a, b){return b.split(" ")[0] - a.split(" ")[0]};
复制代码
|