The following code works fine in Windows XP but gives an error in Vista.
Anyone know how I can have it work in Vista ?
- Code: Select all Expand view
- FUNCTION cSerialMB()
LOCAL oLoc := CREATEOBJECT( "wbemScripting.SwbemLocator" )
LOCAL oSrv := oLoc:ConnectServer()
LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_BaseBoard" )
LOCAL oJob
LOCAL cMBSerial
FOR EACH oJob IN oJbs
cMBSerial := oJob:SerialNumber
NEXT
RETURN cMBSerial
The error I get is:
Error description: Error wbemScripting.SwbemLocator/16389 E_FAIL: CONNECTSERVER