如何查找已安装的 Windows 版本和内部版本号
快速查找计算机上安装的 Windows 操作系统的版本和内部版本号的最简单方法是按Win+R在键盘上并运行winver命令。
以下屏幕截图显示计算机上安装了 Windows 10 版本 22H2(内部版本号 19045.3324)。 Windows 的版本号和内部版本号都允许您唯一地标识计算机上安装的操作系统的版本。

此处提供了包含 Windows 10 所有版本号(版本)和内部版本的表格https://learn.microsoft.com/en-us/windows/release-health/release-information。
您还可以使用以下命令打开系统信息对话框Win+Pause键盘快捷键。这将带您到适当的Settings部分(系统 -> 关于)或系统属性窗口(取决于您的 Windows 版本)。


从Windows 10 20H2开始,控制面板中的经典系统属性小程序被隐藏,无法直接访问。要打开它,请使用以下命令:
shell:::{bb06c0e4-d293-4f75-8a90-cb05b6477eee}
此外,您还可以从命令行获取有关计算机的 Windows 内部版本和版本的信息。运行命令:
systeminfo
可以过滤命令输出:
systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
或者使用WMI命令:
wmic os get Caption, Version, BuildNumber, OSArchitecture


PowerShell 相当于systeminfo命令是获取计算机信息小命令:
Get-ComputerInfo | select OsName, OsVersion, WindowsVersion, OsBuildNumber, OsArchitecture


Get-ComputerInfo cmdlet 的缺点是执行速度相当慢。如果您需要快速检查 Windows 版本并从 PowerShell 脚本进行构建,最好使用以下命令之一。
使用环境变量获取 Windows 版本:
[System.Environment]::OSVersion.Version
来自 WMI 类:
Get-WmiObject -Class Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber
在新版本的 PowerShell Core 中,您必须使用 Get-CimInstance 而不是 Get-WmiObject cmdlet:
Get-CimInstance Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber, OSArchitecture


您可以通过以下值确定计算机上安装的是 x86 还是 x64 版本的 Windows操作系统架构范围。
要找出 Windows 的内部版本和版本号,您还可以检查注册表。
Reg Query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName
Reg Query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v DisplayVersion
Reg Query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v CurrentBuild
或者:
Get-ItemProperty -Path "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersion"| select ProductName, DisplayVersion, CurrentBuild


您可以使用ProductVersion,TargetReleaseVersion, 和TargetReleaseVersionInfoHKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdate 注册表项中的注册表参数用于指定您的设备可以自动升级到的最大目标 Windows 版本。这些选项可用于阻止自动更新到 Windows 11。
使用 PowerShell Remoting 检查远程主机上的 Windows 版本:
Invoke-Command -ScriptBlock {Get-ItemProperty 'HKLM:SOFTWAREMicrosoftWindows NTCurrentVersion' | Select-Object ProductName, ReleaseID, CurrentBuild} -ComputerName dskt-pc01
或者使用 WMI/CIM:
Get-ciminstance Win32_OperatingSystem -ComputerName dskt-pc01 | Select PSComputerName, Caption, OSArchitecture, Version, BuildNumber | FL
如果您的计算机已加入 Active Directory 域,则可以从 AD 中计算机的属性获取 Windows 版本和版本(从 Active Directory 获取 Windows 操作系统版本号)。
您还可以从 ISO 映像或 WIM 文件查找 Windows 版本、版本和内部版本。
