Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining the operating system
Message
From
23/12/1999 05:34:46
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00307402
Message ID:
00307810
Views:
16
>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
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform