回复 apang
嗯嗯,可以,暂时没有发现错误,请加上同时子文件夹的功能,谢谢~!周末愉快~!! ...
awei 发表于 2015-1-10 17:31
把apang在23楼的代码稍微改下即可- @set @n=0;/* & echo off
- set "Js=cscript -nologo -e:jscript"
- ::自行更换成实际路径
- pushd "E:\Test\"
- for /f "tokens=1*" %%a in ('dir /a-d /b /s ^| %Js% "%~0"') do (
- echo,删除文件"%%b"
- Del "%%b" /f /q
- )
- 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] = ("000000000000" + 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");
- if (a.length > 1) {
- WScript.Echo(a.sort().slice(0, -1).join("\n"))
- }
- }
复制代码
|