- @if(0)==(0) echo off
- cscript -nologo -e:jscript "%~0"
- pause & exit/b
- @end
- var startTime = new Date().getTime();
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var folder = fso.GetFolder(".\\Lib");
- var fileCount = folder.Files.Count;
- if (fileCount === 0) {
- WScript.Echo("没有文件");
- } else {
- WScript.Echo("当前目录有 " + fileCount + " 个文件");
- }
- var endTime = new Date().getTime();
- var Seconds = (endTime - startTime) / 1000;
- WScript.Echo("检索时间 " + Seconds + " 秒");
复制代码
|