无论如何,是否可以明确区分这两者?
我意识到我可以在开始屏幕上查找任务栏或电源按钮,但我更想知道是否有任何地方实际显示 8.1 Update 1。我知道 MS 有这个页面,但检测它的编程方式是很好,尤其是当最新的 ISO 有更新时。
据我所知,Windows 8.1 和 Windows 8.1 之间的ver和输出wmic os相同。更新 1,系统属性仍然报告 Windows 8.1。
下面有几个批处理脚本可以检查操作系统是否为 Windows 8.1,有无KB2919355。退出代码将是以下之一:
0: 视窗 8.11:Windows 8.1 更新(已安装 KB2919355)2: 不是 Windows 8.1这是最可靠的方法。该脚本首先通过将版本与6.3.9600. 然后查询所有已安装的更新以验证是否已安装 KB2919355 更新。
@echo off
for /f "usebackq tokens=2 delims==" %%G in (
`wmic os get version /value ^| findstr /c:"="`
) do set version=%%~G
if not "%version%" == "6.3.9600" exit /b 2
wmic qfe get hotfixid | findstr /i /c:"KB2919355" >nul
set /a errorlevel=%errorlevel% ^^ 1
exit /b %errorlevel%
Run Code Online (Sandbox Code Playgroud)
作为替代方案,您可以检查 Windows 构建版本,它比第一个脚本更快,因为您不需要枚举所有更新。由于它使用注册表值,因此它可能不那么可靠。
@echo off
for /f "usebackq tokens=2 delims==" %%G in (
`wmic os get version /value ^| findstr /c:"="`
) do set version=%%~G
if not "%version%" == "6.3.9600" exit /b 2
for /f "tokens=4 delims=. " %%G in (
'"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "BuildLabEx" | findstr /i /c:"REG_SZ" "'
) do set /a build=%%~G
if %build% geq 17031 exit /b 1
exit /b 0
Run Code Online (Sandbox Code Playgroud)
就像前面的脚本一样,这里的概念是相似的,只是检查了 Internet Explorer (IE) 版本。
@echo off
for /f "usebackq tokens=2 delims==" %%G in (
`wmic os get version /value ^| findstr /c:"="`
) do set version=%%~G
if not "%version%" == "6.3.9600" exit /b 2
for /f "tokens=3,6 delims=. " %%G in (
'"reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer" /v "svcVersion" | findstr /i /c:"REG_SZ" "'
) do set /a major=%%~G & set /a build=%%~H
if %major% equ 11 if %build% geq 17031 exit /b 1
if %major% geq 12 exit /b 1
exit /b 0
Run Code Online (Sandbox Code Playgroud)
注意该脚本假定任何高于或等于 12 的 IE 版本都可以在安装了更新 KB2919355 的 Windows 8.1 系统上使用。
Windows RT 8.1、Windows 8.1 和 Windows Server 2012 R2 的所有未来安全和非安全更新都需要安装此更新。我们建议您在基于 Windows RT 8.1、Windows 8.1 或 Windows Server 2012 R2 的计算机上安装此更新,以便接收后续的更新。
来源:Windows RT 8.1、Windows 8.1 和 Windows Server 2012 R2 更新:2014 年 4 月
鉴于上述情况,可以合理地认为任何较新的 IE 版本都需要将更新作为先决条件,就像在 Windows Vista 上安装 IE 9 需要 SP2一样。
| 归档时间: |
|
| 查看次数: |
20599 次 |
| 最近记录: |