OSVersion()

Syntax

Result = OSVersion()
Description
Returns the version of the operating system on which the program has been launched.

'Result' can be one of the following values:
  #PB_OS_Windows_NT3_51
  #PB_OS_Windows_95
  #PB_OS_Windows_NT_4
  #PB_OS_Windows_98
  #PB_OS_Windows_ME
  #PB_OS_Windows_2000
  #PB_OS_Windows_XP
  #PB_OS_Windows_Server_2003
  #PB_OS_Windows_Vista
  #PB_OS_Windows_Server_2008
  #PB_OS_Windows_Future  ; New Windows version (not existent when the program was written)
Example:
  Select OSVersion()
    Case #PB_OS_Windows_98
      MessageRequester("Info", "Windows 98")

    Case #PB_OS_Windows_2000
      MessageRequester("Info", "Windows 2000")
  
    Case #PB_OS_Windows_XP
      MessageRequester("Info", "Windows XP")

    Default
      MessageRequester("Info", "Unsupported Windows version")    
  EndSelect
Note that the constant values are ordered by the time of each versions release, so tests like the following one can be used to catch all versions older or newer than a given one:
  If OsVersion() < #PB_OS_Windows_2000
    ;
    ; All versions older than Windows 2000
    ;
  EndIf

Supported OS

All

<- Green() - Misc Index - RGB() ->