本帖最后由 apang 于 2015-1-10 14:51 编辑
如果回显结果正确,删除第3行的 echo- @set @n=0;/* & echo off
- for /f "tokens=1*" %%a in ('dir /b^|cscript -nologo -e:jscript "%~0"') do (
- echo,Del "%%b"
- )
- pause & exit/b & rem */
-
- dic = new ActiveXObject("Scripting.Dictionary");
- while (!WScript.StdIn.AtEndOfStream) {
- f = WScript.StdIn.ReadLine();
- m = f.match(/.+\.(.+?)\.(\d+)$/);
- if (m) {
- k = m[1].toLowerCase();
- m[2] = ("0000000000" + m[2]).substr(m[2].length);
- if (dic.Exists(k)) {
- dic.Item(k) += "\n" + m[2] + " " + m[0];
- } else dic.Add(k, m[2] + " " + m[0])
- }
- }
-
- arr = (new VBArray(dic.Keys())).toArray();
- for (i=0; i<arr.length; i++) {
- a = dic(arr[i]).split("\n").sort().slice(0, -1);
- WScript.Echo(a.join("\n"))
- }
复制代码
|