Possible solutions
Below there's a few batch scripts which can check whether the operating system is Windows 8.1, with or without KB2919355. The exit code will be one of the following:
0
: Windows 8.1
1
: Windows 8.1 Update (KB2919355 installed)
2
: Not Windows 8.1
Batch script A - Update check
This is the most reliable way. The script first checks if the operating system is Windows 8.1 by comparing the version with 6.3.9600
. Then all installed updates are queried to verify whether the KB2919355 update was installed already.
@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%
Batch script B - Build version check
As an alternative you could check the Windows build version, which is faster then the first script because you don't need to enumerate all updates. Since it uses a registry value, it might not be as reliable.
@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
Batch script C - Build version check (Internet Explorer)
Just like the previous script, here the concept is similar except the Internet Explorer (IE) version is checked instead.
@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
Note The script assumes that any IE version higher or equal to 12 to be available on a Windows 8.1 system with update KB2919355 installed.
All future security and nonsecurity updates for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 require this update to be installed. We recommend that you install this update on your Windows RT 8.1, Windows 8.1, or Windows Server 2012 R2-based computer in order to receive continued future updates.
Source: Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 Update: April 2014
Given the above, it's reasonable to think any newer IE version would require the update as a prerequisite, just like SP2 is required to install IE 9 on Windows Vista.
1You don't. You have to check if the specific Windows Update knowlebase that is "Update 1" is installed. I don't have the number handy its well documented. – Ramhound – 2014-04-15T19:01:05.083
2@Ramhound That only works for systems that were upgraded from 8.1 . . . ISOs on MSDN are now Windows 8.1 with Update, and don't have the Windows Update in their history . . . – ernie – 2014-04-15T19:03:22.483
I don't have Windows 8.1, but I guess the build number should be different after the update. Did you check the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
registry key? – and31415 – 2014-04-15T19:09:30.2232@and31415 the build version is reported in the
ver
output (6.3.9600), and is the same for both. The problem I'm trying to solve is just knowing what systems we have in our lab, and what OS they're running . . . for full test coverage, we want to keep both 8.1 and 8.1 with Update 1 – ernie – 2014-04-15T19:12:46.3571@ernie What about the values stored in the registry location above? If you want to check whether the update is installed you could use something like this:
wmic qfe get hotfixid | findstr /i /c:"KB2919355"
– and31415 – 2014-04-15T20:36:11.1602@and31415 I should have been more explicit. Both the
ver
output and the registry info are identical. The wmic/findstr method seems like it'll work (even on systems that were installed from the new ISOs), though it's ugly as sin (especially since it's basically going to be a secondary check after aver
check) . . . post that as an answer and I'll accept it . . . – ernie – 2014-04-15T21:19:03.8702@Ramhound I understand you can't update it, but we test software here, and just like we've got users who are still running XP without service packs, we assume we'll have users with 8.1 without having updated. We need comprehensive coverage to make sure our software works in all environments, and having wide breadth of systems is important to us. – ernie – 2014-04-15T21:20:12.153
Alright I understand; I was just trying to avoid needless work on your part; check the IE11 version IE11 was updated I am pretty sure. – Ramhound – 2014-04-15T21:28:43.807