0

Hia all Is there any method using VB.NET API to detect Win Edition (e.g. Home/Professional/...)

I tried the sample i found here How can I determine the Windows version from a VB 6 app?, but osv.OSVSize = Len(osv) gets me an error in VB2010Espress: Variable 'osv' is used before it has been assigned a value...

PS I don't want to use WMI

Community
  • 1
  • 1
Remus Rigo
  • 1,454
  • 8
  • 34
  • 60

2 Answers2

1

The following is not at all bullet proof (as the string returned may vary according to the culture and may change without warning in a new version of windows) but it may be good enough for what you want:

    If My.Computer.Info.OSFullName.ToUpper.Contains("PROFESSIONAL") Then
        Debug.WriteLine("Proffessional")
    ElseIf My.Computer.Info.OSFullName.ToUpper.Contains("HOME") Then
        Debug.WriteLine("Home")
    elseif ...
        'etc
    End If
Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
0

I just found GetProductInfo into Kernel32.dll, looking into it....

Remus Rigo
  • 1,454
  • 8
  • 34
  • 60