I need assistance in obtaining the system uptime using BGinfo.
I have tried various methods, including PowerShell and VBScript, but unfortunately, I haven't been able to display the uptime information on the BGinfo desktop wallpaper.
Can anyone help me with this issue? Your assistance would be greatly appreciated.
Thanks
I have attempted to retrieve the system uptime value using various methods, including WMI, PowerShell, and VBS scripts. However, I am facing difficulties in integrating the PowerShell script into the BGinfo application. Here is the PowerShell script that I have been working with to obtain the system uptime:
$ComputerName = $env:COMPUTERNAME
$userSystem = Get-WmiObject win32_operatingsystem -ComputerName $ComputerName -ErrorAction SilentlyContinue
if ($userSystem.LastBootUpTime) {
$sysuptime= (Get-Date) -
$userSystem.ConvertToDateTime($userSystem.LastBootUpTime)
Write-Output ("Last boot: " +
$userSystem.ConvertToDateTime($userSystem.LastBootUpTime) )
Write-Output ("Uptime : " + $sysuptime.Days + " Days " +
$sysuptime.Hours + " Hours " + $sysuptime.Minutes + " Minutes" )
}
else {
Write-Warning "Unable to connect to $computername"
}
I would like to learn how to incorporate a PowerShell script into the BGinfo application to display the system uptime information on the desktop. By integrating the PowerShell script with BGinfo, I aim to show the current system's uptime as part of the desktop information. Any guidance or instructions on how to achieve this would be highly appreciated.