When I issue the following command in a CMD prompt, the correct value is returned for the AdapterRAM object:
WMIC Path Win32_VideoController Get AdapterRAM
The correct value of 8589934592 is returned. However when I utilize VBScript with the same query, an incorrect value is returned for the same AdapterRam object:
sPC = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sPC & "\root\cimv2")
Set cSettings = objWMIService.ExecQuery("Select AdapterRAM From Win32_VideoController Where DeviceID='VideoController1'")
For Each oPC in cSettings
GPURAMSize = oPC.AdapterRAM
WScript.Echo GPURAMSize
Next
The incorrect value of -1048576 is returned for the same AdapterRAM object.
Am I missing something here? Why the difference in values returned between utilizing the same query from a CMD prompt versus a VBScript?
Thanks in advance.