Jump to content

Timer question


polps
 Share

Recommended Posts

Hello all,

how to get the time elapsed since the computer is powered on?

Thanks

Hi,

try this:

$strComputer = "."
$objWMIService = ObjGet ("winmgmts:\\" & $strComputer & "\root\cimv2")
$colitem = $objWMIService.ExecQuery ("Select * From Win32_PerfFormattedData_PerfOS_System"); Where Default = True")
For $objos in $colitem
    $systemuptime = Int ($objos.systemuptime / 60)
    MsgBox (0, "", $systemuptime & " minutes")
Next
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...