如何知道电脑是否重新启动
我使用网络唤醒重新启动远程计算机,我想知道是否有办法知道计算机在登录屏幕上处于空闲状态(以便我可以开始执行需要完成的操作)。
I reboot a remote computer with Wake-on-Lan and I would like to know if there is a way to know that the computer is idling at login screen (so I can start to do the stuff that need to be done).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 Wmi 查询 Win32_OperatingSystem 并获取 LastBootupTime。如果自您上次查询以来它发生了变化,那么您可以知道它已启动并响应 WMI 查询,这通常意味着它已启动并正在运行。
您也可以 ping,但我相信即使计算机尚未完全启动,ping 也可以响应。您可以 ping 然后等待 60 秒然后尝试。
但归根结底,它并不是让您知道您可以执行操作的登录屏幕(除非您想在计算机本身上执行操作)。如果您想通过 WMI 执行操作,则应该检查 WMI 连接性。
You could use a Wmi query to Win32_OperatingSystem and get the LastBootupTime. If it changed since you last queried it then you can know that its booted up and responding to WMI queries, which usually means its up and running.
You could also ping, but i believe ping can respond even if the computer hasn't fully booted up yet. You could ping then wait for 60 seconds then try.
Ultimately though, its not the login screen which let's you know you can do things (unless you want to do things on the computer itself). If you want to do things through WMI, you should check WMI connectivity instead.
尝试对其进行 ping 操作或通过 TCP/IP 连接到某个正在侦听的服务。我很确定即使您尚未登录,也有服务在监听。
try to ping it or connect over TCP/IP to some service that is listening. I am pretty sure there are services listening even though you have not logged in.