≡ Menu

Windows Version in registry key

If you want to query the Windows OS version from a batch file or from a program then you can Windows registry. Windows Registry stores all the details like OS name, Service pack number, Version name etc. It also points to the source location from where the OS is installed. All this data is stored in the registry key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion.

The above registry key has the following registry values.

SubVersionNumber    REG_SZ
CurrentBuild        REG_SZ  1.511.1 () (Obsolete data – do not use)
InstallDate REG_DWORD       0x4c69e464
ProductName REG_SZ  Microsoft Windows XP
RegDone     REG_SZ
RegisteredOrganization      REG_SZ 
RegisteredOwner     REG_SZ 
SoftwareType        REG_SZ  SYSTEM
CurrentVersion      REG_SZ  5.1
CurrentBuildNumber  REG_SZ  2600
BuildLab    REG_SZ  2600.xpsp_sp2_qfe.080814-1242
CurrentType REG_SZ  Multiprocessor Free
CSDVersion  REG_SZ  Service Pack 2
SystemRoot  REG_SZ  C:WINDOWS
SourcePath  REG_SZ  D:i386
PathName    REG_SZ  C:WINDOWS
ProductId   REG_SZ  XXXX-XXX-XXXX-XXXXX

I have highlighted the ones that can be useful. OS name can be queried from ProductName registry value.
CSDVersion tells us the service pack number.

{ 1 comment… add one }
  • Bubba April 4, 2013, 12:10 am

    In the case of Windows 7, which Registry value will tell be whether the system is 32- or 64-bit (WoW64)?

    thanks

Leave a Comment