-
Notifications
You must be signed in to change notification settings - Fork 0
/
OSVersion2.vbs
25 lines (20 loc) · 949 Bytes
/
OSVersion2.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
' ************************************************************************************************************
' Purpose: Get Windows 10 Version for BgInfo
' Pre-Reqs: Windows 10
' Modified by Tyrone Wyatt
' Last Modified: 19/07/2021
' ************************************************************************************************************
On Error Resume Next
Set WshShell = CreateObject("WScript.Shell")
' Windows 10 versions 2004 or older
ReleaseId = wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId")
' Windows 10 version 20H2 or newer
DisplayVersion = wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion")
' If DisplayVersion Exists Then Echo DisplayVersion Else Echo ReleaseId
If (DisplayVersion) Then
'WScript.Echo DisplayVersion
Echo DisplayVersion
Else
'WScript.Echo ReleaseId
Echo ReleaseId
End If