Welcome, Guest. Please login or register. Did you miss your activation email?
Britec Computer Tech Help Support Forums  « General Chat « Chit Chat « To all members of the fourm (Find out your Original Install date time and days)
Pages: [1]
  Print  
Author Topic: To all members of the fourm (Find out your Original Install date time and days)  (Read 373 times)
BJseal91
Hero Member
*****
Posts: 699



View Profile
« on: November 19, 2009, 02:01:01 AM »

To All Our Members this is a script I have wrote out for you to anyone intrested in seing

1/ Orignial Install Date
2/ Time of Install Date
3/ Days passed since that Install date

This can be useful or just intresting to see how long you have had your o/s for Smiley

here is the code;

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objOS = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each strOS in objOS
    dtmInstallDate = strOS.InstallDate
    strReturn = WMIDateStringToDate(dtmInstallDate)
    Wscript.Echo strReturn
Next

sAgeInDays = DateDiff("d", strReturn, Now)
WScript.Echo "That was " & sAgeInDays & " days ago."

Function WMIDateStringToDate(dtmInstallDate)
    WMIDateStringToDate = CDate(Mid(dtmInstallDate, 5, 2) & "/" & _
         Mid(dtmInstallDate, 7, 2) & "/" & Left(dtmInstallDate, 4) _
         & " " & Mid (dtmInstallDate, 9, 2) & ":" & _
         Mid(dtmInstallDate, 11, 2) & ":" & Mid(dtmInstallDate, _
         13, 2))
End Function

copy and paste this code into notepad.exe and save the file as install date and time.vbs
the .vbs is the most inportant bit it must be at the end enjoy people and let us know what you think

or Download Here: install_date_and_time.rar
« Last Edit: November 20, 2009, 05:49:52 AM by Britec » Logged
Britec
Administrator
Hero Member
*****
Posts: 3346



View Profile
« Reply #1 on: November 20, 2009, 05:50:39 AM »

Hey....nice work man I added a download link for you script
Logged



shammon
Newbie
*
Posts: 21


View Profile
« Reply #2 on: December 04, 2009, 04:34:17 AM »

 Wink Fab Thanks.
Logged
Pages: [1]
  Print  
 
Jump to: