OS( ) Function

Returns the name and version number of the operating system under which Microsoft Visual FoxPro is running.

OS([nValue])

Return Values

Character

Parameters

  • nValue
    Specifies the item to return, according to the following table.

    nValues

    Value Description
    1 Specifies that the name and version number of the operating system is returned.
    2 DBCS Support. If DBCS (Double Byte Character Sets) are supported, "DBCS" is returned. Otherwise, an empty string is returned
    3 Identifies the major version number of the operating system. For example, for Windows 2000, the major version number is 5.
    4 Identifies the minor version number of the operating system. For example, for Windows 2000, the minor version number is 0.
    5 Identifies the build number of the operating system.
    6 Identifies the operating system platform.
    7 Contains a string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.
    8 Identifies the major version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the major version number is 3. If no Service Pack has been installed, the value is zero.
    9 Identifies the minor version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the minor version number is 0.
    10 A set of bit flags that identify the product suites available on the system. See Product Suite bit flag table below for values.
    11 Indicates additional information about the system. See Product Type settings table below for values.

Product Suite bit flags:

Value Meaning
1 Microsoft Small Business Server is installed.
2 Windows® 2000 Advanced Server is installed.
4 Microsoft BackOffice components are installed.
16 Terminal Services is installed.
32 Microsoft Small Business Server is installed with the restrictive client license in force.
64 Windows Embedded NT is installed
128 Windows 2000 DataCenter Server is installed.
256 Single user (instance) Terminal Services enabled.

Product Type settings:

Value Meaning
1 Windows 2000 Professional
2 Windows 2000 domain controller
3 Windows 2000 Server

Remarks

If you omit the optional argument, this function returns the underlying operating system name and its version number.

nValues greater than 2 are new in this version of Visual FoxPro.

Some nValues are not applicable to some operating systems. In such cases, the OS( ) function returns "0" or "", an empty string.

Example

? OS( )
? OS(1)
? OS(2)

See Also

DISKSPACE( ) | GETENV( ) | VERSION( )