OSdetect.exe uses a Windows API to determine the Computer's Operating System. OSdetectMod.bas: Attribute VB_Name = "OSdetectMod" Option Explicit ' Form Name: OSdetectMod.bas ' Author: Tyler Travis, Eruption Software ' www.travis-usa.com ' Date: 3/6/01 Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type ' dwPlatformId defines: ' Public Const VER_PLATFORM_WIN32s = 0 Public Const VER_PLATFORM_WIN32_WINDOWS = 1 Public Const VER_PLATFORM_WIN32_NT = 2 Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long ============================= frmOSdetect.frm calls the Windows API, then uses Windows CONSTANTS to determine which OS is running. VERSION 5.00 Begin VB.Form frmOSdetect BackColor = &H00404040& Caption = " OSdetect" ClientHeight = 2565 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 BeginProperty Font Name = "MS Sans Serif" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Icon = "frmOSdetect.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 2565 ScaleWidth = 4680 StartUpPosition = 1 'CenterOwner Begin VB.CommandButton cmdExit Caption = "E&xit" Height = 375 Left = 1320 TabIndex = 2 Top = 1920 Width = 2175 End Begin VB.CommandButton cmdGetOS Caption = "&Get OS" Height = 375 Left = 1800 TabIndex = 1 Top = 1320 Width = 1215 End Begin VB.Label lblOS Alignment = 2 'Center BackColor = &H000000FF& BorderStyle = 1 'Fixed Single Caption = "ZZZZZZ" BeginProperty Font Name = "Impact" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty ForeColor = &H00FFFFFF& Height = 615 Left = 840 TabIndex = 0 Top = 360 Width = 3135 End End Attribute VB_Name = "frmOSdetect" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim IsWindows95% Dim IsWindowsNT% Dim IsWindows2K% ' Form Name: frmOSdetect.frm ' Author: Tyler Travis, Eruption Software ' www.travis-usa.com ' Date: 3/6/01 Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdGetOS_Click() Dim dl& Dim osinfo As OSVERSIONINFO osinfo.dwOSVersionInfoSize = Len(osinfo) dl& = GetVersionEx(osinfo) If osinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then IsWindows95 = True lblOS.Caption = "Windows 9x" ElseIf osinfo.dwPlatformId = VER_PLATFORM_WIN32_NT Then If (osinfo.dwMajorVersion >= 5) Then 'Windows 2000 or later... IsWindows2K% = True lblOS.Caption = "Windows 2000" Else IsWindowsNT% = True lblOS.Caption = "Windows NT" End If End If End Sub ============================= OSdetect.vbp Type=Exe Form=frmOSdetect.frm Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\stdole2.tlb#OLE Automation Module=OSdetectMod; OSdetectMod.bas IconForm="frmOSdetect" Startup="frmOSdetect" Command32="" Name="OSdetect" HelpContextID="0" CompatibleMode="0" MajorVer=1 MinorVer=0 RevisionVer=0 AutoIncrementVer=0 ServerSupportFiles=0 VersionCompanyName="Eruption Software and Tyler Travis." CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0 BoundsCheck=0 OverflowCheck=0 FlPointCheck=0 FDIVCheck=0 UnroundedFP=0 StartMode=0 Unattended=0 Retained=0 ThreadPerObject=0 MaxNumberOfThreads=1