All depends on how many possibilites you want to cover
you can use "GetVersionEx" or the just the "GetVersion"
Public Declare Function GetVersionEx Lib "kernel32" _
Alias "GetVersionExA" _
(lpVersionInformation As OSVERSIONINFO) As Boolean
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
But that won't tell you if you are running server or workstation versions of NT.
You can also use the registry key "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions"
If you know you are running windows NT.
This gives you Operating System, Major Version, Minor Version
Not sure what Win 2000 does, hopefully just has higher major and minor numbers. Let us know how you go.
Heres a good link Where Am I Running?