I'm writing a VBScript that should identify the OS details. I found an exemple here using InstancesOf Win32_Operating system, but instead of the foreach loop from the sample, I only want to address the first occurence, so I did:
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
Set System = SystemSet.Item(0)
Also tried Set System = SystemSet(0), but each time I have a generic failure error message (Echec générique in french).
How can I achieve this so I can then compare the System.Caption string?