Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vb.net - use .net to determine the version of OS ...

Posted on 2010-08-14
4
Medium Priority
?
521 Views
Last Modified: 2013-11-27
My vb.net is installed on my client and I need to determeine what version of the OS..where it is installed..is there a programatical way of determing this?
0
Comment
Question by:GlobaLevel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
fvitt72 earned 668 total points
ID: 33439053
If you are looking to see how to programmatically see what OS is installed look at this link:

http://www.vb-helper.com/howto_net_os_version.html

For the question, where it is installed?  Are you looking to find a programmatical way of checking to see where VB.NET is installed on each workstation?
0
 
LVL 17

Assisted Solution

by:Zhaolai
Zhaolai earned 668 total points
ID: 33439180
Here is the code to even detect Windows 7.
1. OS info: Download the attached class. To call the class, use the following code:

        Dim sb As New System.Text.StringBuilder([String].Empty)

        sb.AppendLine("Operation System Information")
        sb.AppendLine("----------------------------")
        sb.AppendLine([String].Format("Name = {0}", OSVersionInfo.Name))
        sb.AppendLine([String].Format("Edition = {0}", OSVersionInfo.Edition))
        If OSVersionInfo.ServicePack <> String.Empty Then
            sb.AppendLine([String].Format("Service Pack = {0}", OSVersionInfo.ServicePack))
        Else
            sb.AppendLine("Service Pack = None")
        End If
        sb.AppendLine([String].Format("Version = {0}", OSVersionInfo.VersionString))
        sb.AppendLine([String].Format("ProcessorBits = {0}", OSVersionInfo.ProcessorBits))
        sb.AppendLine([String].Format("OSBits = {0}", OSVersionInfo.OSBits))
        sb.AppendLine([String].Format("ProgramBits = {0}", OSVersionInfo.ProgramBits))

        TextBox1.Text = sb.ToString()

2. Where it is installed:
   If you just want to get the name of the computer where you program is running on, use:

   My.Computer.Name

OSVersionInfo.vb
0
 
LVL 10

Author Comment

by:GlobaLevel
ID: 33439221
would this work..I saw on a recent EE posting...
Public Function OS_VERSION() As String
        '  WE NEED TO DETERMINE THE VERSION OF THE OS
        Dim osInfo As OperatingSystem
        Dim sAns As String
        sAns = ""
        osInfo = System.Environment.OSVersion
        With osInfo
            Select Case .Platform
                Case System.PlatformID.Win32Windows
                    Select Case (.Version.Minor)
                        Case 0
                            sAns = "Windows 95"
                            OLD_WINDOWS_VERSION()
                        Case 10
                            If .Version.Revision.ToString() = "2222A" Then
                                sAns = "Windows 98 Second Edition"
                                OLD_WINDOWS_VERSION()
                            Else
                                sAns = "Windows 98"
                                OLD_WINDOWS_VERSION()
                            End If
                        Case 90
                            sAns = "Windows Me"
                            OLD_WINDOWS_VERSION()
                    End Select
                Case System.PlatformID.Win32NT
                    Select Case (.Version.Major)
                        Case 2
                            sAns = ""
                            WINDOWS_NT_VERSION()
                        Case 3
                            sAns = "Windows NT 3.51"
                            WINDOWS_NT_VERSION()
                        Case 4
                            sAns = "Windows NT 4.0"
                            WINDOWS_NT_VERSION()
                        Case 5
                            If .Version.Minor = 0 Then
                                sAns = "Windows 2000"
                                WINDOWS_NT_VERSION()
                            ElseIf .Version.Minor = 1 Then
                                sAns = "Windows XP"
                                WINDOWS_NT_VERSION()
                            ElseIf .Version.Minor = 2 Then
                                sAns = "Windows Server 2003"
                                WINDOWS_NT_VERSION()
                            Else 'Future version maybe update
                                'as needed
                                sAns = "Unknown Windows Version"
                                WINDOWS_NT_VERSION()
                            End If
                        Case 6
                            Select Case .Version.Minor
                                Case 0I
                                    sAns = "Windows Vista"
                                    RECENT_WINDOWS_VERSION()
                                Case 1I
                                    sAns = "Windows 2008"
                                    RECENT_WINDOWS_VERSION()
                                Case 2I
                                    sAns = "Windows 7"
                                    RECENT_WINDOWS_VERSION()
                            End Select
                    End Select
            End Select
        End With
        Return sAns
0
 
LVL 19

Assisted Solution

by:Shahan Ayyub
Shahan Ayyub earned 664 total points
ID: 33440079
Hi! GlobaLevel

You found a solution in the above post. I also recommend Environment.OSVersion if it was not present here.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question