这样子应该行吧- @if (0)/*==(0)/* echo off
-
- set /a day=2*24*3600
-
- for /f %%i in ('cscript //nologo //e:jscript "%~f0"') do set n=%%i
- set n=%n:~0,-3%
-
- if %day% leq %n% (
- echo 大于或等于2天
- ) else (
- echo 小于2天
- )
-
- pause&exit/b
- rem */@end
-
- var nil=null,td=new Date(),dt=new ActiveXObject('WbemScripting.SWbemDateTime');
- for(var e=new Enumerator(GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem"));!e.atEnd();e.moveNext())
- {
- dt.value=e.item().LastBootUpTime;
- WScript.Echo(td-dt.GetVarDate());
- }
- dt=nil;
复制代码
|