Results 1 to 17 of 17

Thread: Determine OS Version and Details (includes Vista support)

  1. #1

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Arrow Determine OS Version and Details (includes Vista support)

    I included detection for 95/98/ME even though its highly unlikely that those OS' will be running the Framework and also that 95 doesnt support it.

    Just wanted to say Thanks to those that helped with getting the final touches working:
    VBDT
    Negative0
    bmahler

    There is still a little more work to be done for 2003 but I figure I will post what I have done for now and update it later just so others can start
    using it and report any issues that may arise.


    I had to trim out the trusts, dll imports and enums to fit but its all included in the zip attachment.
    Code attachment written on 2003 SP1

    Code:
    Option Explicit On 
    Option Strict On
    'VB.NET FAQ Written by RobDog888 (vbforums.com)
    Imports System.Runtime.InteropServices
    
    Public Class Form1
    
        Inherits System.Windows.Forms.Form
    
        "Windows Form Designer generated code"
    
        "STRUCTS AND ENUMS"
    
        "DLLS AND CONSTS"
    
        Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
            Me.Close()
        End Sub
    
        Private Sub btnDetectOS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetectOS.Click
            txtDetectOS.Text = GetOSPlatVerType()
        End Sub
    
        Private Function GetOSPlatVerType() As String
            'Windows Server "Longhorn" 6.0 
            'Windows Vista 6.0 
            'Windows Server 2003 R2 5.2 
            'Windows Server 2003 5.2
            'Windows XP Professional x64 Edition 5.2
            'Windows XP Pro 5.1
            'Windows XP Home 5.1
            'Windows Server 2000 5.0
            'Windows 2000 Pro 5.0 
            'Windows ME 4.90
            'Windows 98 4.10
            'Windows 95 4.0
            'Windows NT4 4.0
            Dim osvi As OSVERSIONINFO = New OSVERSIONINFO
            Dim xosvi As OSVERSIONINFOEX = New OSVERSIONINFOEX
            Dim iRet As Int32 = 0
            Dim strDetails As String = String.Empty
            osvi.dwOSVersionInfoSize = Marshal.SizeOf(GetType(OSVERSIONINFO))
            xosvi.dwOSVersionInfoSize = Marshal.SizeOf(GetType(OSVERSIONINFOEX))
            Try
                iRet = System.Environment.OSVersion.Platform
                If iRet = 1 Then
                    iRet = GetVersionAdv(osvi)
                    strDetails = Environment.NewLine & "Version: " & _
                    osvi.dwMajorVersion & "." & osvi.dwMinorVersion & "." & osvi.dwBuildNumber & _
                    Environment.NewLine & osvi.szCSDVersion
                    Select Case Len(osvi)
                        Case 0
                            Return "Windows 95" & strDetails
                        Case 10
                            Return "Windows 98" & strDetails
                        Case 9
                            Return "Windows ME" & strDetails
                    End Select
                Else '2 (NT)
                    iRet = GetVersionEx(xosvi)
                    strDetails = Environment.NewLine & "Version: " & _
                    xosvi.dwMajorVersion & "." & xosvi.dwMinorVersion & "." & xosvi.dwBuildNumber & Environment.NewLine & _
                    xosvi.szCSDVersion & " (" & xosvi.wServicePackMajor & "." & xosvi.wServicePackMinor & ")"
                    Select Case xosvi.dwMajorVersion
                        Case OSMajorVersion.VER_OS_NT4
                            Return "Windows NT 4" & strDetails
                        Case OSMajorVersion.VER_OS_2K_XP_2K3
                            Select Case xosvi.dwMinorVersion
                                Case 0
                                    '2000
                                    Select Case xosvi.wProductType
                                        Case WinPlatform.VER_NT_WORKSTATION
                                            Return "Windows 2000 Pro" & strDetails
                                        Case WinPlatform.VER_NT_SERVER
                                            If (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_DATACENTER) = WinSuiteMask.VER_SUITE_DATACENTER Then
                                                Return "Windows 2000 Datacenter Server" & strDetails
                                            ElseIf (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_ENTERPRISE) = WinSuiteMask.VER_SUITE_ENTERPRISE Then
                                                Return "Windows 2000 Advanced Server" & strDetails
                                            ElseIf (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_SMALLBUSINESS) = WinSuiteMask.VER_SUITE_SMALLBUSINESS Then
                                                Return "Windows 2000 Small Business Server" & strDetails
                                            Else
                                                Return "Windows 2000 Server" & strDetails
                                            End If
                                        Case WinPlatform.VER_NT_DOMAIN_CONTROLLER
                                            If (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_DATACENTER) = WinSuiteMask.VER_SUITE_DATACENTER Then
                                                Return "Windows 2000 Datacenter Server Domain Controller" & strDetails
                                            ElseIf (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_ENTERPRISE) = WinSuiteMask.VER_SUITE_ENTERPRISE Then
                                                Return "Windows 2000 Advanced Server Domain Controller" & strDetails
                                            ElseIf (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_SMALLBUSINESS) = WinSuiteMask.VER_SUITE_SMALLBUSINESS Then
                                                Return "Windows 2000 Small Business Server Domain Controller" & strDetails
                                            Else
                                                Return "Windows 2000 Server Domain Controller" & strDetails
                                            End If
                                    End Select
                                Case 1
                                    'XP
                                    If (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_PERSONAL) = WinSuiteMask.VER_SUITE_PERSONAL Then
                                        Return "Windows XP Home Edition" & strDetails
                                    Else
                                        Return "Windows XP Professional Edition" & strDetails
                                    End If
                                Case 2
                                    '2003/Vista
                                    Select Case xosvi.wProductType
                                        Case WinPlatform.VER_NT_WORKSTATION
                                            Return "Windows XP Professional x64 Edition" & strDetails
                                        Case WinPlatform.VER_NT_SERVER
                                            If GetSystemMetrics(SM_SERVERR2) = 1 Then
                                                Return "Windows Server 2003 R2" & strDetails
                                            Else
                                                Return "Windows Server 2003" & strDetails
                                            End If
                                        Case WinPlatform.VER_NT_DOMAIN_CONTROLLER
                                            If GetSystemMetrics(SM_SERVERR2) = 1 Then
                                                Return "Windows Server 2003 R2 Domain Controller" & strDetails
                                            Else
                                                Return "Windows Server 2003 Domain Controller" & strDetails
                                            End If
                                    End Select
                            End Select
                        Case OSMajorVersion.VER_OS_VISTA_LONGHORN
                            If xosvi.wProductType = WinPlatform.VER_NT_WORKSTATION Then
                                If (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_PERSONAL) = WinSuiteMask.VER_SUITE_PERSONAL Then
                                    Return "Windows Vista (Home Premium, Home Basic, or Home Ultimate) Edition"
                                Else
                                    Return "Windows Vista (Enterprize or Business)" & strDetails
                                End If
                            Else
                                Return "Windows Server (Longhorn)" & strDetails
                            End If
                    End Select
                End If
            Catch
                MessageBox.Show(GetLastError.ToString)
                Return String.Empty
            End Try
    
        End Function
    
    End Class
    Attached Files Attached Files
    Last edited by RobDog888; Dec 30th, 2008 at 04:34 AM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Determine OS Version and Details (includes Vista support)

    Good code by robort sir

  3. #3
    New Member
    Join Date
    Dec 2006
    Posts
    11

    Re: Determine OS Version and Details (includes Vista support)

    good work, now if only i'd looked on here at the start of te day i would have saved myself alot of searching and piecing together bits of other peoples code to find out all you have put

  4. #4

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Determine OS Version and Details (includes Vista support)

    We all have days like that.

    Did you find anything additional that could be added to the code? Does it work correctly for you?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    New Member
    Join Date
    Dec 2006
    Posts
    11

    Re: Determine OS Version and Details (includes Vista support)

    possibly add the service pack level as well?? Ive not actually tried your code but it looks similar to mine.

  6. #6

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Determine OS Version and Details (includes Vista support)

    Service pack info is in the strDetails variable along with the build version.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Determine OS Version and Details (includes Vista support)

    Been looking for this for vb6
    Does anyone have code like this for vb6

  8. #8

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Determine OS Version and Details (includes Vista support)

    Its practically the same. Not too hard to convert it to VB 6.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: Determine OS Version and Details (includes Vista support)


  10. #10
    Lively Member
    Join Date
    Apr 2007
    Location
    NYC
    Posts
    86

    Re: Determine OS Version and Details (includes Vista support)

    Here is a pretty basic program, all it requires is a form with four buttons, and it will work properly, this is the entire code, hope you like . By the way, the information is shown in a Messagebox.
    VB Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4.  
    5.     End Sub
    6.  
    7.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    8.         '
    9.         'Returns Operating System Name, Platform and Version
    10.         '
    11.         MsgBox(" Operating System Name: " & My.Computer.Info.OSFullName & vbNewLine & " Operating System Platform: " & My.Computer.Info.OSPlatform.ToString & vbNewLine & " Operating System Version: " & My.Computer.Info.OSVersion.ToString, , )
    12.  
    13.  
    14.  
    15.     End Sub
    16.  
    17.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    18.         '
    19.         'Returns the total amount of Physical and Virtual Memory for the Computer.
    20.         '
    21.         MsgBox(" Total Physical Memory: " & My.Computer.Info.TotalPhysicalMemory.ToString & " bytes" & vbNewLine & " Total Virtual Memory: " & My.Computer.Info.TotalVirtualMemory.ToString & " bytes ")
    22.  
    23.  
    24.     End Sub
    25.  
    26.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    27.         '
    28.         'Get the displays current Resolution.
    29.         '
    30.         MsgBox(" Current Resolution: " & My.Computer.Screen.Bounds.Width.ToString & "x" & My.Computer.Screen.Bounds.Height.ToString & " Pixels")
    31.  
    32.     End Sub
    33.  
    34.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    35.         '
    36.         'Get the amount of Physical and Virtual Memory that is available.
    37.         '
    38.         MsgBox(" Available Physical Memory: " & My.Computer.Info.AvailablePhysicalMemory.ToString & " bytes" & vbNewLine & " Available Virtual Memory: " & My.Computer.Info.AvailableVirtualMemory.ToString & " bytes")
    39.  
    40.     End Sub
    41. End Class
    There is a thin line between hobby, and obsession.

    If you found my post helpful, please rate it.
    My Laptop System Stats: nVidia 8800 graphics card, Two Intel Core Duo processors, 3.5 GB RAM, Windows Vista Ultimate, 15.4 Widescreen Brightview display, Built-in Webcam and Microphone.
    My Alienware System Stats: nVidia 8800 graphics card, Intel Core Duo Extreme Edition processors, 4 gb RAM, Windows Vista Ultimate, 21 Inch Plasma Display, 42 Inch LCD HD display.

  11. #11

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Determine OS Version and Details (includes Vista support)

    Yes, thats the easy way when you only need simple OS name or version. My code gets the suitemasks for a more detailed return.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Determine OS Version and Details (includes Vista support)

    To expand on this since MS has announced that Windows 7's internal version # is 6.2, here's the function that includes that:
    Code:
        Friend Function GetOSVersion() As String
            Dim strVersion As String = "Unknown"
            Select Case Environment.OSVersion.Platform
                Case PlatformID.Win32S
                    strVersion = "Windows 3.1"
                Case PlatformID.Win32Windows
                    Select Case Environment.OSVersion.Version.Minor
                        Case 0I
                            strVersion = "Windows 95"
                        Case 10I
                            If Environment.OSVersion.Version.Revision.ToString() = "2222A" Then
                                strVersion = "Windows 98 Second Edition"
                            Else
                                strVersion = "Windows 98"
                            End If
                        Case 90I
                            strVersion = "Windows ME"
                    End Select
                Case PlatformID.Win32NT
                    Select Case Environment.OSVersion.Version.Major
                        Case 3I
                            strVersion = "Windows NT 3.51"
                        Case 4I
                            strVersion = "Windows NT 4.0"
                        Case 5I
                            Select Case Environment.OSVersion.Version.Minor
                                Case 0I
                                    strVersion = "Windows 2000"
                                Case 1I
                                    strVersion = "Windows XP"
                                Case 2I
                                    strVersion = "Windows 2003"
                            End Select
                        Case 6I
                            Select Case Environment.OSVersion.Version.Minor
                                Case 0I
                                    strVersion = "Windows Vista"
                                Case 1I
                                    strVersion = "Windows 2008"
                                Case 2I
                                    strVersion = "Windows 7"
                            End Select
                    End Select
                Case PlatformID.WinCE
                    strVersion = "Windows CE"
                Case PlatformID.Unix
                    strVersion = "Unix"
            End Select
            Return strVersion
        End Function
    Last edited by JuggaloBrotha; May 9th, 2009 at 06:32 AM.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  13. #13
    Hyperactive Member vbcode1980's Avatar
    Join Date
    Nov 2005
    Location
    Anywhere the wind blows
    Posts
    365

    Re: Determine OS Version and Details (includes Vista support)

    If you simply want the name and version, than the WMI class WIN32_Operating_System contains the full description as well
    (Including versions for Vista and Server)
    I code C#....

  14. #14

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Determine OS Version and Details (includes Vista support)

    Well my original code determines what flavor of Vista as well as other OS' which wont show in in the WMI classes. Just depends upon how much detail you need/want
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15

    Re: Determine OS Version and Details (includes Vista support)

    EDIT:
    Windows 7's internal version # is 6.2
    Weird, cause my Windows 7 Ultimate's Internal number is 6.1

    vb.net Code:
    1. Case OSMajorVersion.VER_OS_VISTA_LONGHORN
    2.                         Select Case xosvi.dwMinorVersion
    3.                             Case 0
    4.                                 If xosvi.wProductType = WinPlatform.VER_NT_WORKSTATION Then
    5.                                     If (xosvi.wSuiteMask And WinSuiteMask.VER_SUITE_PERSONAL) = WinSuiteMask.VER_SUITE_PERSONAL Then
    6.                                         Return "Windows Vista (Home Premium, Home Basic, or Home Ultimate) Edition"
    7.                                     Else
    8.                                         Return "Windows Vista (Enterprize or Business)" & strDetails
    9.                                     End If
    10.                                 Else
    11.                                     Return "Windows Server (Longhorn)" & strDetails
    12.                                 End If
    13.                             Case 1
    14.                                 Return "Windows 7"
    15.                         End Select
    This addon will do basic Windows 7 checking...and I mean basic
    Last edited by formlesstree4; Dec 22nd, 2009 at 08:32 PM. Reason: Readding all the crap I deleted

  16. #16
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Determine OS Version and Details (includes Vista support)

    Code:
    If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major = 6I AndAlso Environment.OSVersion.Version.Minor = 1I Then
        'Running Win7 (any)
    End If
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  17. #17
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Determine OS Version and Details (includes Vista support)

    Quote Originally Posted by JuggaloBrotha View Post
    Code:
    If Environment.OSVersion.Platform = PlatformID.Win32NT AndAlso Environment.OSVersion.Version.Major = 6I AndAlso Environment.OSVersion.Version.Minor = 1I Then
        'Running Win7 (any)
    End If
    That IF statement will not only return true for Windows 7 - it will return true for Server 2008 R2 as well as that has the same version number
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width