Windows 7 启动/引导的时间

发布于 2024-12-28 13:05:04 字数 1550 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

吝吻 2025-01-04 13:05:04

PowerShell 和系统事件日志非常适合此任务。请注意,ID 为 12 的事件是系统启动事件,而 ID 13 表示系统关闭事件。以下 PowerShell 脚本将提供系统在一个月内的启动和关闭时间。

echo "Start time:"
Get-EventLog System -After 12/21/2011 | ? {$_.EventId -eq 12} | % {$_.TimeGenerated}
echo "Shutdown time:"
Get-EventLog System -After 12/21/2011 | ? {$_.EventId -eq 13} | % {$_.TimeGenerated}

12/21/2011 替换为您想要的任何日期。单击“开始”菜单,键入“powershell”,然后输入将启动 Windows PowerShell。

PowerShell and System Event Log are perfectly designed for this task. Note events with id 12 is a System Start Up event while an id 13 indicates System Shutdown. The following PowerShell script will provide the start and shutdown time of your system in one month.

echo "Start time:"
Get-EventLog System -After 12/21/2011 | ? {$_.EventId -eq 12} | % {$_.TimeGenerated}
echo "Shutdown time:"
Get-EventLog System -After 12/21/2011 | ? {$_.EventId -eq 13} | % {$_.TimeGenerated}

Substitute the 12/21/2011 to any date you wish. Click Start Menu, type "powershell" and then enter will launch Windows PowerShell.

萌梦深 2025-01-04 13:05:04

在 Windows XP 中,只需键入

systeminfo| find "System Up Time"

It 即可显示系统运行时间。

it is possible in windows xp just type

systeminfo| find "System Up Time"

It will display system up time.

穿透光 2025-01-04 13:05:04

以下是检查系统启动\正常运行时间的步骤。

  1. 打开任务管理器(通过 alt+ctrl+del,然后单击“启动任务管理器”,或者转到开始菜单运行命令并键入“taskmgr.exe”,然后按 Enter 键) 。
  2. 单击Perfomance 选项卡
  3. 在底部中间附近查找System 组,

然后它会在 DD::HH::MM:: 中显示Uptime SS 格式。

Here are the following steps to checking your systems startup \ uptime.

  1. Open up task manager (either from alt+ctrl+del, then clicking on "Start Task Manager", or from going to your start menus run command and typing "taskmgr.exe", then hitting enter).
  2. Click on the Perfomance tab
  3. Look for the System group near the bottom middle

It will then say Uptime in DD::HH::MM::SS format.

橙味迷妹 2025-01-04 13:05:04

要找出这些信息,您可以编写一个程序来 grep 通过事件日志

To figure out this information, you can write a program to grep through the Event Log

心头的小情儿 2025-01-04 13:05:04

如果您试图记录所有启动和关闭时间的日志,您将需要某种日志。您可以自己编写一个,也可以查看 Microsoft 在 Windows 7 中提供的内容。为此,请查看以下教程。

http://www.sevenforums.com /tutorials/177443-gathering-startup-shutdown-sleep-hibernate-reboot-trace.html

If you are attempting to have logs of all your startup and shutdown times, you are going to want some kind of a log. You can either write one your self, or you can take a look at what Microsoft has provided in Windows 7. To do so, take a look at the following tutorial.

http://www.sevenforums.com/tutorials/177443-gathering-startup-shutdown-sleep-hibernate-reboot-trace.html

み青杉依旧 2025-01-04 13:05:04

您想通过编程代码来做到这一点吗?就像在 C/C++ 代码中一样?

GetTickCount64()返回自系统启动以来的毫秒数。仅限 Vista 及更高版本。 (所以这应该适用于 Windows 7)。

如果您必须在早于 Vista 或 Win2K8 服务器的操作系统上运行,则可以使用普通的旧 GetTickCount() - 在 49.7 天左右后循环回零。

然后使用其他时间/日期函数来获取当前时间。从当前时间减去 GetTickCount 或 GetTickCount64 返回的值。那是系统最后一次启动的时间。

Did you want to do this via programming code. As in C/C++ code?

GetTickCount64() returns the number of milliseconds since the system was started. Vista and up only. (So this should work for Windows 7).

If you have to run on operating systems older than Vista or Win2K8 server, there's plain old GetTickCount() - which loops back to zero after 49.7 days or so.

Then use the other time/date functions to get the current time. Subtract the value returned by GetTickCount or GetTickCount64 from the current time. That's when the system was last started up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文