如何查找已安裝的 Windows 版本和內部版本號

Jacki

快速查找計算機上安裝的 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

閱讀更多:修復“Windows 無法安裝到此磁盤”錯誤

或者:

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 版本、版本和內部版本。