Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Operating System full Value(Vista Home, Ultimate ...)
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Operating System full Value(Vista Home, Ultimate ...)
Miscellaneous
Thread ID:
01210361
Message ID:
01210361
Views:
64
Hi,

I'm in the process of making my 2 freeware play nicer with Vista.

At the moment, I'm using this code below to get the full name of the OS(ie."Windows XP professional Service Pack 2"). If I get an error, my error handler returns a .NULL. under Vista. I'm using my HTPC with "Vista Home Premium" and would like that value. How do you do that with Vista/VFP and still work in XP?
LOCAL lcComputerName, loWMI, lowmiWin32Objects, lowmiWin32Object
lcComputerName = GETWORDNUM(SYS(0),1)
loWMI = GETOBJECT("WinMgmts://" + lcComputerName)
lowmiWin32Objects = loWMI.InstancesOf("Win32_OperatingSystem")
FOR EACH lowmiWin32Object IN lowmiWin32Objects
    WITH lowmiWin32Object
        RETURN  .Caption + " "+.CSDVersion
    ENDWITH
ENDFOR
Thanks for your answers ;)
Lead programmer of the free MIS Info Video(Frontend/player), Info 2 MIS or visit me at Steve's Tech Blog
Reply
Map
View

Click here to load this message in the networking platform