KAG

spruce....

All Posts..

How to know the date of OS installed

Posted by Aditya on June 22, 2011 at 7:43 AM

To run the script, copy the following lines to a Notepad document, and save as a file with .VBS extension (use double-quotes) and double-click the file. The installation date and time would be displayed.

 



strComputer = "."

Set dtmInstallDate = CreateObject( _

  "WbemScripting.SWbemDateTime")

Set objWMIService = GetObject("winmgmts:" _

  & "{impersonationLevel=impersonate}!\\" _

  & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _

  ("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems

  MsgBox "Install Date: " & getmydat (objOperatingSystem.InstallDate)

Next Function getmydat(wmitime)

  dtmInstallDate.Value = wmitime

  getmydat = dtmInstallDate.GetVarDate

End function

 


Categories: System

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments