Share via


OS( ) Function

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

OS([nValue])

Return Value

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 or Windows Server 2003, Enterprise Edition, is installed.

4

Microsoft BackOffice components are installed.

16

Terminal Services are installed.

32

Microsoft Small Business Server is installed with the restrictive client license in force.

64

Windows Embedded NT is installed

128

Windows 2000 or Windows Server 2003, Datacenter Edition, is installed.

256

Terminal Services is installed, but only one interactive session is supported.

512

Windows XP Home Edition is installed.

1024

Windows Server 2003, Web Edition, is installed.

Product Type settings:

Value

Meaning

1

The system is running Windows NT 4.0 Workstation, Windows 2000 Professional, Windows XP Home Edition, or Windows XP Professional.

2

The system is a domain controller.

3

The system is a server.

Remarks

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

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

Reference

DISKSPACE( ) Function

GETENV( ) Function

VERSION( ) Function

Other Resources

Functions