-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOSEdition.vbs
21 lines (17 loc) · 849 Bytes
/
OSEdition.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
' ************************************************************************************************************
' Purpose: Get OS Edition
' Modified by Tyrone Wyatt
' Last Modified: 25/01/2022
' ************************************************************************************************************
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\root\cimv2")
Set OperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each OperatingSystem in OperatingSystems
If Not IsNull(OperatingSystem.Caption) Then
If InStr(OperatingSystem.Caption,"Microsoft") = 1 Then
OperatingSystem.Caption = Trim(Replace(OperatingSystem.Caption,"Microsoft",""))
End If
'WScript.Echo OperatingSystem.Caption
Echo OperatingSystem.Caption
End If
Next