Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining the operating system
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00307402
Message ID:
00307882
Vues:
15
>>>Is there a way to determine what the current Operating System is at run time? Specifically whether NT Workstation or NT Server is running. The OS() function does not give this detail.
>>>
>>
>>You can retrieve the details from the registry.
>>
>>From the NT FAQ at www.ntfaq.com:
>>
>>Q. How can I check what type of NT installation I have?
>>
>>A. There are now many types of NT installation, Windows NT Workstation, NT Server, NT domain controllers, Terminal Server Edition and Enterprise addition. The normal way would be to just type "net accounts" however this will not give all the information sometimes. One way to check is to look in the registry
>>
>>Start the registry editor (regedt32.exe)
>>Move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
>>Look at ProductType, it will be one of
>>WinNT - Windows NT Workstation
>>ServerNT - Windows NT Server standalone
>>LanmanNT - Windows NT Server Domain Controller
>>You can also look at ProductSuite (if it exists), and depending on your version you may see
>>Terminal Server - Windows NT Terminal Server Edition
>>Enterprise - Windows NT Enterprise Edition
>>Close the registry editor
>>If you attempt to open or edit these values (depending on your service pack) a warning will be shown and the value changed back to its original. Don't try to change them.
>>
>>If you don't want to muck around in the registry, WinInfo (from http://www.savilltech.com/download/wininfo.zip) displays the Product Type (and much more) and will be one of
>>
>>Windows NT Workstation
>>Windows NT Server
>>Windows NT Domain Controller
>>Windows Terminal Server Edition
>>Windows NT Enterprise Edition
>
>Ed,
>
>Could GetVersionEx() be of any use here?

Distinguishing between NT versions, no, since the code base is identical, and the extended OSVERSIONINFOEX structure is only implemented in Win2K. Take a look at the MSDN doc for the lpVersionInfo parameter to see what has to be done differently.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform