如何在桌面上使用 BGinfo 获得正常运行时间?

问题描述 投票:0回答:0

here the example of the system uptime我需要帮助来使用 BGinfo 获取系统正常运行时间。

我尝试了各种方法,包括PowerShell和VBScript,但不幸的是,我一直无法在BGinfo桌面壁纸上显示正常运行时间信息。

有人可以帮我解决这个问题吗?非常感谢您的帮助?

谢谢

我尝试使用各种方法检索系统正常运行时间值,包括 WMI、PowerShell 和 VBS 脚本。但是,我在将 PowerShell 脚本集成到 BGinfo 应用程序时遇到了困难。这是我一直在使用的用于获取系统正常运行时间的 PowerShell 脚本:

$ComputerName = $env:COMPUTERNAME $userSystem = Get-WmiObject win32_operatingsystem -ComputerName $ComputerName -ErrorAction SilentlyContinue 如果($userSystem.LastBootUpTime){ $sysuptime= (获取日期) - $userSystem.ConvertToDateTime($userSystem.LastBootUpTime) 写入输出(“上次启动:” + $userSystem.ConvertToDateTime($userSystem.LastBootUpTime) ) 写入输出(“正常运行时间:” + $sysuptime.Days + “天” + $sysuptime.Hours + “小时” + $sysuptime.Minutes + “分钟”) } 别的 { 写警告“无法连接到 $computername” }

我想了解如何将PowerShell脚本合并到BGinfo应用程序中以在桌面上显示系统正常运行时间信息。通过将 PowerShell 脚本与 BGinfo 集成,我的目标是将当前系统的正常运行时间作为桌面信息的一部分显示。任何有关如何实现这一目标的指导或指示将不胜感激。

system desktop uptime
© www.soinside.com 2019 - 2024. All rights reserved.