Obtener version de windows

hello
19 de Enero del 2004
Agradezco si alguien me pudiera colaborar con un codigo que me permita obtener la version de windows que está instalada en una maquina donde se ejecuta mi aplicacion.
Gracias

sdemingo
19 de Enero del 2004
Hola,

Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Sub Form_Load()
Dim OSInfo As OSVERSIONINFO, PId As String

Me.AutoRedraw = True

OSInfo.dwOSVersionInfoSize = Len(OSInfo)

Ret& = GetVersionEx(OSInfo)

If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub

Select Case OSInfo.dwPlatformId
Case 0
PId = "Windows 32s"
Case 1
PId = "Windows 95/98"
Case 2
PId = "Windows NT/2000"
End Select
Print "Sistema Operativo: " + PId
Print "Versión:" + Str$(OSInfo.dwMajorVersion) + "." + LTrim(Str(OSInfo.dwMinorVersion))
Print "Build: " + Str(OSInfo.dwBuildNumber)

End Sub

Saludos
sdemingo