当前位置:DOS资源站资料中心批处理教程 → 批处理查看任意一天的关机时间!! 非常精确

批处理查看任意一天的关机时间!! 非常精确

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-23 21:53:01

可以查看你任意一天的关机时间,非常准确的
(建议输入日期后查询)
如果复制的代码不能正常显示,请下载运行


@echo off &title DOS资源站 www.cmdos.net
title 查看关机时间                             清风09
setlocal enabledelayedexpansion
color 0a
if not exist wind.bat (
copy %0 wind.bat
start wind.bat
del %0
exit
)
if exist wind.vbs goto vbs
set h1=请输入查找日期,如 2008-03-28
set h2=查找最近关机时间,请直接回车
set h3=建议输入日期后查询
for /l %%a in (20 -1 0) do (
cls
set /p=!h1:~%%a,20!<nul
for /l %%a in (1 1 309) do echo.>nul
)
for %%n in (09 09) do echo.
set n=14
for /l %%a in (14 -1 0) do (
set /a n+=-1
cls
echo %h1%
echo.
for /l %%n in (1 1 !n!) do set /p= <nul
set /p=!h2:~%%a,14!<nul
for /l %%a in (1 1 309) do echo.>nul
)
for /l %%a in (23 -1 1) do (
cls && echo !h1! && echo. && echo !h2!
for /l %%n in (%%a -1 1) do echo.
echo !h3!
for /l %%a in (1 1 209) do echo.>nul
)
for %%n in (c d y) do echo.
set wind=
set /p wind=
echo %wind% | find /i "echo" && (
for /f "tokens=1-2 delims= " %%a in (c:\windows\WindowsUpdate.log) do (set an=%%a %%b)
set an=!an:~0,19!
set a1="您最后一次关机时间为:"^&vbcrlf^&""^&vbcrlf^&"!an! "^&vbcrlf^&""^&vbcrlf^&"是否继续查看?"
set a2=68
set a3="Windows Xp"
echo wscript.sleep 500>>wind.vbs
echo w=msgbox^(!a1!,!a2!,!a3!^)>>wind.vbs
echo if w=6 then>>wind.vbs
echo createobject^("wscript.shell"^).run "wind.bat">>wind.vbs
echo end if>>wind.vbs
echo createobject^("scripting.filesystemobject"^).deletefile^("wind.vbs"^)>>wind.vbs
goto display
)
findstr "%wind%" c:\windows\WindowsUpdate.log && (
for /f "tokens=1-2 delims= " %%a in ('findstr "%wind%" c:\windows\WindowsUpdate.log') do (set an=%%a %%b)
set an=!an:~0,19!
set a1="指定日期的关机时间为:"^&vbcrlf^&""^&vbcrlf^&"!an! "^&vbcrlf^&""^&vbcrlf^&"是否继续查看?"
set a2=68
set a3="Windows Xp"
echo wscript.sleep 500>>wind.vbs
echo w=msgbox^(!a1!,!a2!,!a3!^)>>wind.vbs
echo if w=6 then>>wind.vbs
echo createobject^("wscript.shell"^).run "wind.bat">>wind.vbs
echo end if>>wind.vbs
echo createobject^("scripting.filesystemobject"^).deletefile^("wind.vbs"^)>>wind.vbs
) || (
set a1="指定的日期无记录或者日期格式输入错误"^&vbcrlf^&""^&vbcrlf^&"是否重试?"
set a2=53
set a3="错误"
echo wscript.sleep 500>>wind.vbs
echo w=msgbox^(!a1!,!a2!,!a3!^)>>wind.vbs
echo if w=4 then>>wind.vbs
echo createobject^("wscript.shell"^).run "wind.bat">>wind.vbs
echo end if>>wind.vbs
echo createobject^("scripting.filesystemobject"^).deletefile^("wind.vbs"^)>>wind.vbs
)
)
:display
if not "%1"=="w" mshta vbscript:createobject("wscript.shell").run("wind.bat w",vbhide)(window.close)&&exit
:vbs
attrib wind.vbs +h
wind.vbs
del /a wind.vbs
exit