Re: How to display OS Name in short name ? by kimiraikkonen
kimiraikkonen
Wed Jul 23 05:51:06 CDT 2008
On Jul 23, 12:21 pm, "engteng" <pass...@gmail.com> wrote:
> How to display OS Name in short Name eg Win Vista SP1
> Win X=
P
> 2003 SP2
>
> Regards,
> Tee ET
For XP,
You can you can manually define them in nested if-then blocks like the
following:
' --------Begin Code-----------
'Check and get full OSName
If My.Computer.Info.OSFullName.ToString =3D _
"Microsoft Windows XP Professional" Then
'Check and get service pack version
If Environment.OSVersion.ServicePack.ToString =3D _
"Service Pack 2" Then
MsgBox("Win XP SP2")
End If
ElseIf My.Computer.Info.OSFullName.ToString =3D _
"Microsoft Windows XP Professional" Then
'Assuming no or other Service Packs are installed
' plus only XP is installed
MsgBox("Win XP")
End If
'.....Reproduce same for Vista
' ------End Code-----------
Or you can use substring method to fit OSName/SPVersion output to what
you desire.
Hope this helps,
Onur G=FCzel