question

OSD-4642 avatar image
0 Votes"
OSD-4642 asked OSD-4642 answered

VB.Net and Installed Operating System Type (OEM or VL)

Hi,

Currently I am checking the Windows 10 license type if it's Volume License (VL) or Pre-Installed (OEM) with slmg.vbs from a command prompt, like this:
135035-image.png

Is it possible to check the same with VB.Net? If its OEM, show form1, if its VL show form2?

dotnet-visual-basic
image.png (9.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered

You can use WMI to get the string (that's what slmgr does). For example,

         Dim LicQuery As SelectQuery = New SelectQuery("SELECT * From SoftwareLicensingProduct")
         Dim Lic As ManagementObjectSearcher = New ManagementObjectSearcher(LicQuery)
         For Each l In Lic.Get()
             Dim s As String = l("Description")
             Console.WriteLine(s)
         Next

I'll leave it to you to parse the returned string. :)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

Yes you can. You could convert the VBScript file you referenced to VB as it is mostly VB you'd just have to make some adjustments.

Alternatively look at what the script is doing and just do the same in VB. Most if it is looking at registry entries from what I can see.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OSD-4642 avatar image
0 Votes"
OSD-4642 answered

Thank you, will check it out.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.