- //&cls&@cscript -nologo -e:jscript "%~f0"&exit
- var FSO = new ActiveXObject('Scripting.FileSystemObject');
- var Folder = new Enumerator(FSO.GetFolder(FSO.GetFile(WScript.ScriptFullName).ParentFolder.Path).SubFolders);
- while (!Folder.atEnd()) {
- FileCount(Folder.item());
- Folder.moveNext();
- }
-
- function FileCount(FolderName) {
- var n = 0;
- var Folder_ = FSO.GetFolder(FolderName);
- var Files = new Enumerator(Folder_.Files);
- while (!Files.atEnd()) {
- n += 1;
- Files.moveNext();
- }
- Folder_.Name = Folder_.Name + '-' + n;
- }
复制代码 练手 |