This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows?
The best I c
I find the creation date of c:\pagefile.sys can be pretty reliable in most cases. It can easily be obtained using this command (assuming Windows is installed on C:):
dir /as /t:c c:\pagefile.sys
The '/as' specifies 'system files', otherwise it will not be found. The '/t:c' sets the time field to display 'creation'.
You can do this with PowerShell:
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\' -Name InstallDate |
Select-Object -Property @{n='InstallDate';e={[DateTime]::new(1970,1,1,0,0,0,0,'UTC').AddSeconds($_.InstallDate).ToLocalTime()}}
Open command prompt, type "systeminfo" and press enter. Your system may take few mins to get the information. In the result page you will find an entry as "System Installation Date". That is the date of windows installation. This process works in XP ,Win7 and also on win8.
Very simple way from PowerShell:
(Get-CimInstance -Class Win32_OperatingSystem).InstallDate
Extracted from: https://www.sysadmit.com/2019/10/windows-cuando-fue-instalado.html
In Powershell run the command:
systeminfo | Select-String "Install Date:"
Windows 10 OS has yet another registry subkey, this one in the SYSTEM hive file:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\
The Install Date information here is the original computer OS install date/time. It also tells you when the update started, ie
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\Source OS (Updated on xxxxxx)."
This may of course not be when the update ends, the user may choose to turn off instead of rebooting when prompted, etc...
The update can actually complete on a different day, and
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\Source OS (Updated on xxxxxx)"
will reflect the date/time it started the update.