举个栗子- //&cls&dir /b *_*.txt|mshta "%~f0"&pause&exit
-
- <script>
- var fso = new ActiveXObject('Scripting.Filesystemobject');
- var a = {}, s = '';
- try{
- var files = fso.GetStandardStream(0).ReadAll().split(/\r\n/);
- for(var i = 0; i<files.length; i++){
- var t = files[i].split('_')[0].toUpperCase();
- if(t){!a[t]? a[t]=1 : a[t]++;}
- }
- for(var b in a){
- if(a[b]>1)s+=b +' : '+ a[b] +'\r\n';
- }
- alert(s);
- }catch(e){}
- close();
- </script>
复制代码
|