Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Operating System full Value(Vista Home, Ultimate ...)
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Operating System full Value(Vista Home, Ultimate ...)
Divers
Thread ID:
01210361
Message ID:
01210361
Vues:
63
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
Répondre
Fil
Voir

Click here to load this message in the networking platform