473,735 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get if the Windows running is a server version?

Hi,
How can I get if the Windows running is a server version?

Is there a property somewhere that can tell me if the Windows version is a
server edition (including server, advanced server, web server, etc) or just
a workstation (if it's not a workstation, then it's a server). My app must
verifies that for security reasons. It should work from at least windows
2000 (Windows 98 and ME, would appreciated to, but if it's not possible,
I'll put it in the system requirements)

Thanks

ThunderMusic
Oct 18 '05 #1
10 3491
Just to be sure, what I mean by "from at least Windows 2000", I mean "from
Windows 2000 and up (so XP and 2003, et al.)

"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > a écrit dans le message de
news: OW************* *@TK2MSFTNGP09. phx.gbl...
Hi,
How can I get if the Windows running is a server version?

Is there a property somewhere that can tell me if the Windows version is a
server edition (including server, advanced server, web server, etc) or
just a workstation (if it's not a workstation, then it's a server). My app
must verifies that for security reasons. It should work from at least
windows 2000 (Windows 98 and ME, would appreciated to, but if it's not
possible, I'll put it in the system requirements)

Thanks

ThunderMusic

Oct 18 '05 #2
ThunderMusic,
Have you looked at System.Environm ent.OSVersion?

For details see:
http://support.microsoft.com/kb/304289
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| Hi,
| How can I get if the Windows running is a server version?
|
| Is there a property somewhere that can tell me if the Windows version is a
| server edition (including server, advanced server, web server, etc) or
just
| a workstation (if it's not a workstation, then it's a server). My app must
| verifies that for security reasons. It should work from at least windows
| 2000 (Windows 98 and ME, would appreciated to, but if it's not possible,
| I'll put it in the system requirements)
|
| Thanks
|
| ThunderMusic
|
|
Oct 18 '05 #3
Thanks, but it gives me the version of windows running, 95, 98, 2000, xp,
2003, etc, but it doesn't tell me if the Windows edition is server or
workstation, even the build numbers are the same for both(if I'm not
mistaken). Whether it is win9x, 2000, xp or 2003 doesn't matter to me, I
just want to know if it's workstation(or home, or pro) or server.

Is there another way to know? (by a method, a property or even a registry
key)

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit dans
le message de news: Ok************* *@TK2MSFTNGP10. phx.gbl...
ThunderMusic,
Have you looked at System.Environm ent.OSVersion?

For details see:
http://support.microsoft.com/kb/304289
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| Hi,
| How can I get if the Windows running is a server version?
|
| Is there a property somewhere that can tell me if the Windows version is
a
| server edition (including server, advanced server, web server, etc) or
just
| a workstation (if it's not a workstation, then it's a server). My app
must
| verifies that for security reasons. It should work from at least windows
| 2000 (Windows 98 and ME, would appreciated to, but if it's not possible,
| I'll put it in the system requirements)
|
| Thanks
|
| ThunderMusic
|
|

Oct 18 '05 #4
ThunderMusic,
The only other options I can think of is GetSystemMetric s, however after a
quick look I don't see a SM_SERVER value (just a SM_SERVERR2 for Windows
Server 2003 "R2" value).

I know MSDN Magazine (http://msdn.microsoft.com/msdnmag) has a topic every
once in a while on getting the "real" OS you are on, however I don't see one
right now.
Here is some info on use GetSystemMetric s from an earlier post of mine:

According to the Microsoft Tablet PC SDK:

<quote>
Q. How can I determine if my application is running on a Tablet PC?
A. Use the Windows GetSystemMetric s API and pass in SM_TABLETPC as the value
of the index. SM_TABLETPC is defined in Winuser.h. The value of SM_TABLETPC
is 86. The method returns True or nonzero if the Microsoft Windows XP Tablet
PC Edition operating system is running; False or zero otherwise.

Applications should not rely on a true or nonzero value to mean all Tablet
PC components are installed and working. See the following question for
details on how to determine if Tablet PC components are installed.

</quote>

There is also a MediaCenter system metrics value.

I would expect System.Windows. Forms.SystemInf ormation would list both values
as it gives most other SystemMetrics, however it appears to be missing
TabletPC (SM_TABLETPC) & MediaCenter (SM_MEDIACENTER ).

You can use code similar to:

Public Enum SystemMetric As Integer
TabletPC = 86
MediaCenter = 87
End Enum

Declare Auto Function GetSystemMetric s Lib "User32" (ByVal index As
SystemMetric) As Integer

If GetSystemMetric s(SystemMetric. TabletPC) <> 0 Then
Debug.WriteLine ("On a Tablet PC")
Else
Debug.WriteLine ("Not on a Tablet PC")
End If

If GetSystemMetric s(SystemMetric. MediaCenter ) <> 0 Then
Debug.WriteLine ("On a Media Center PC")
Else
Debug.WriteLine ("Not on a Media Center PC")
End If

I've used the Tablet PC value reliably, I don't have a Media Center PC to
verify the Media Center value.

I'm not sure how to tell the difference between Home & Pro.

Hope this helps
Jay
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
| Thanks, but it gives me the version of windows running, 95, 98, 2000, xp,
| 2003, etc, but it doesn't tell me if the Windows edition is server or
| workstation, even the build numbers are the same for both(if I'm not
| mistaken). Whether it is win9x, 2000, xp or 2003 doesn't matter to me, I
| just want to know if it's workstation(or home, or pro) or server.
|
| Is there another way to know? (by a method, a property or even a registry
| key)
|
| Thanks
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans
| le message de news: Ok************* *@TK2MSFTNGP10. phx.gbl...
| > ThunderMusic,
| > Have you looked at System.Environm ent.OSVersion?
| >
| > For details see:
| > http://support.microsoft.com/kb/304289
| >
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
| > news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| > | Hi,
| > | How can I get if the Windows running is a server version?
| > |
| > | Is there a property somewhere that can tell me if the Windows version
is
| > a
| > | server edition (including server, advanced server, web server, etc) or
| > just
| > | a workstation (if it's not a workstation, then it's a server). My app
| > must
| > | verifies that for security reasons. It should work from at least
windows
| > | 2000 (Windows 98 and ME, would appreciated to, but if it's not
possible,
| > | I'll put it in the system requirements)
| > |
| > | Thanks
| > |
| > | ThunderMusic
| > |
| > |
| >
| >
|
|
Oct 18 '05 #5
ok, you lead me on a good path, but the information is not in
GetSystemMetric s. Instead, I found it in the GetVersionEx function I got
from the System Information Functions link at the bottom of the page.

So for those who want to know, the information is in GetVersionEx using a
pointer of type OSVERSIONINFOEX , you can get the information into the
wProductType property. It can be one of the following values :
VER_NT_WORKSTAT ION, VER_NT_DOMAIN_C ONTROLLER or VER_NT_SERVER.

Now, all I have to do is find a way to access this function from within my
..net app (I never worked with win32 APIs from within .NET before. Anybody
have a link to get me on the right track? (I know there are many many many
examples on the web, I will probably find one suitable before anyone post
here, but if I don't.....))

Thanks a lot

ThunderMusic

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit dans
le message de news: un************* *@TK2MSFTNGP14. phx.gbl...
ThunderMusic,
The only other options I can think of is GetSystemMetric s, however after a
quick look I don't see a SM_SERVER value (just a SM_SERVERR2 for Windows
Server 2003 "R2" value).

I know MSDN Magazine (http://msdn.microsoft.com/msdnmag) has a topic every
once in a while on getting the "real" OS you are on, however I don't see
one
right now.
Here is some info on use GetSystemMetric s from an earlier post of mine:

According to the Microsoft Tablet PC SDK:

<quote>
Q. How can I determine if my application is running on a Tablet PC?
A. Use the Windows GetSystemMetric s API and pass in SM_TABLETPC as the
value
of the index. SM_TABLETPC is defined in Winuser.h. The value of
SM_TABLETPC
is 86. The method returns True or nonzero if the Microsoft Windows XP
Tablet
PC Edition operating system is running; False or zero otherwise.

Applications should not rely on a true or nonzero value to mean all Tablet
PC components are installed and working. See the following question for
details on how to determine if Tablet PC components are installed.

</quote>

There is also a MediaCenter system metrics value.

I would expect System.Windows. Forms.SystemInf ormation would list both
values
as it gives most other SystemMetrics, however it appears to be missing
TabletPC (SM_TABLETPC) & MediaCenter (SM_MEDIACENTER ).

You can use code similar to:

Public Enum SystemMetric As Integer
TabletPC = 86
MediaCenter = 87
End Enum

Declare Auto Function GetSystemMetric s Lib "User32" (ByVal index As
SystemMetric) As Integer

If GetSystemMetric s(SystemMetric. TabletPC) <> 0 Then
Debug.WriteLine ("On a Tablet PC")
Else
Debug.WriteLine ("Not on a Tablet PC")
End If

If GetSystemMetric s(SystemMetric. MediaCenter ) <> 0 Then
Debug.WriteLine ("On a Media Center PC")
Else
Debug.WriteLine ("Not on a Media Center PC")
End If

I've used the Tablet PC value reliably, I don't have a Media Center PC to
verify the Media Center value.

I'm not sure how to tell the difference between Home & Pro.

Hope this helps
Jay
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
| Thanks, but it gives me the version of windows running, 95, 98, 2000,
xp,
| 2003, etc, but it doesn't tell me if the Windows edition is server or
| workstation, even the build numbers are the same for both(if I'm not
| mistaken). Whether it is win9x, 2000, xp or 2003 doesn't matter to me, I
| just want to know if it's workstation(or home, or pro) or server.
|
| Is there another way to know? (by a method, a property or even a
registry
| key)
|
| Thanks
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans
| le message de news: Ok************* *@TK2MSFTNGP10. phx.gbl...
| > ThunderMusic,
| > Have you looked at System.Environm ent.OSVersion?
| >
| > For details see:
| > http://support.microsoft.com/kb/304289
| >
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
| > news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| > | Hi,
| > | How can I get if the Windows running is a server version?
| > |
| > | Is there a property somewhere that can tell me if the Windows
version
is
| > a
| > | server edition (including server, advanced server, web server, etc)
or
| > just
| > | a workstation (if it's not a workstation, then it's a server). My
app
| > must
| > | verifies that for security reasons. It should work from at least
windows
| > | 2000 (Windows 98 and ME, would appreciated to, but if it's not
possible,
| > | I'll put it in the system requirements)
| > |
| > | Thanks
| > |
| > | ThunderMusic
| > |
| > |
| >
| >
|
|

Oct 18 '05 #6
Hi,
Now, all I have to do is find a way to access this function from within my .net app (I never worked with win32 APIs from within .NET before. Anybody have a link to get me on the right track? (I know there are many many many examples on the web, I will probably find one suitable before anyone post here, but if I don't.....))


In case you didn't...

~
Friend Declare Auto Function GetVersionEx Lib "kernel32.d ll" ( _
ByRef lpVersionInfo As OSVersionInfoEx _
) As Boolean

<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Auto)> Friend
Structure OSVersionInfoEx
Public dwOSVersionInfo Size As Integer
Public dwMajorVersion As Integer
Public dwMinorVersion As Integer
Public dwBuildNumber As Integer
Public dwPlatformId As Integer
<MarshalAs(Unma nagedType.ByVal TStr, SizeConst:=128) > Public
szCSDVersion As String
Public wServicePackMaj or As Short
Public wServicePackMin or As Short
Public wSuiteMask As Short
Public wProductType As Byte
Public wReserved As Byte
End Structure

Const VER_NT_DOMAIN_C ONTROLLER As Byte = 2
Const VER_NT_SERVER As Byte = 3
Const VER_NT_WORKSTAT ION As Byte = 1

Protected Overrides Sub OnClick(ByVal e As System.EventArg s)
MyBase.OnClick( e)
Dim OSVIEx As OSVersionInfoEx
OSVIEx.dwOSVers ionInfoSize =
Marshal.SizeOf( GetType(OSVersi onInfoEx))
GetVersionEx(OS VIEx)
Select Case OSVIEx.wProduct Type
Case VER_NT_DOMAIN_C ONTROLLER
MessageBox.Show ("That's a DOMAIN CONTROLLER!")
Case VER_NT_SERVER
MessageBox.Show ("It's server OS")
Case VER_NT_WORKSTAT ION
MessageBox.Show ("Workstatio n. Just a workstation.")
Case 0
MessageBox.Show ("Ha! It's probably a 98/ME system, or an
old version of NT.")
Case Else
MessageBox.Show ("??? Your kernel32.dll is broken?")
End Select
End Sub
~

HTH,
Roman
Oct 18 '05 #7
ThunderMusic,
Doh! I looked at GetVersionEx & OSVERSIONINFO only, I didn't check
OSVERSIONINFOEX .

Thanks for letting us know you found it, I'll have to save a copy of this
for next time.

Let us know if you can't get Dragon's code to work (it looks like it should
work for you).

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect & Enthusiast
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:uk******** *****@tk2msftng p13.phx.gbl...
| ok, you lead me on a good path, but the information is not in
| GetSystemMetric s. Instead, I found it in the GetVersionEx function I got
| from the System Information Functions link at the bottom of the page.
|
| So for those who want to know, the information is in GetVersionEx using a
| pointer of type OSVERSIONINFOEX , you can get the information into the
| wProductType property. It can be one of the following values :
| VER_NT_WORKSTAT ION, VER_NT_DOMAIN_C ONTROLLER or VER_NT_SERVER.
|
| Now, all I have to do is find a way to access this function from within my
| .net app (I never worked with win32 APIs from within .NET before. Anybody
| have a link to get me on the right track? (I know there are many many many
| examples on the web, I will probably find one suitable before anyone post
| here, but if I don't.....))
|
| Thanks a lot
|
| ThunderMusic
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans
| le message de news: un************* *@TK2MSFTNGP14. phx.gbl...
| > ThunderMusic,
| > The only other options I can think of is GetSystemMetric s, however after
a
| > quick look I don't see a SM_SERVER value (just a SM_SERVERR2 for Windows
| > Server 2003 "R2" value).
| >
<<snip>>
Oct 18 '05 #8
http://pinvoke.net/default.aspx/kernel32.GetVersionEx
--
Phil Wilson [MVP Windows Installer]
----
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:uk******** *****@tk2msftng p13.phx.gbl...
ok, you lead me on a good path, but the information is not in
GetSystemMetric s. Instead, I found it in the GetVersionEx function I got
from the System Information Functions link at the bottom of the page.

So for those who want to know, the information is in GetVersionEx using a
pointer of type OSVERSIONINFOEX , you can get the information into the
wProductType property. It can be one of the following values :
VER_NT_WORKSTAT ION, VER_NT_DOMAIN_C ONTROLLER or VER_NT_SERVER.

Now, all I have to do is find a way to access this function from within my
.net app (I never worked with win32 APIs from within .NET before. Anybody
have a link to get me on the right track? (I know there are many many many
examples on the web, I will probably find one suitable before anyone post
here, but if I don't.....))

Thanks a lot

ThunderMusic

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans le message de news: un************* *@TK2MSFTNGP14. phx.gbl...
ThunderMusic,
The only other options I can think of is GetSystemMetric s, however after
a
quick look I don't see a SM_SERVER value (just a SM_SERVERR2 for Windows
Server 2003 "R2" value).

I know MSDN Magazine (http://msdn.microsoft.com/msdnmag) has a topic
every
once in a while on getting the "real" OS you are on, however I don't see
one
right now.
Here is some info on use GetSystemMetric s from an earlier post of mine:

According to the Microsoft Tablet PC SDK:

<quote>
Q. How can I determine if my application is running on a Tablet PC?
A. Use the Windows GetSystemMetric s API and pass in SM_TABLETPC as the
value
of the index. SM_TABLETPC is defined in Winuser.h. The value of
SM_TABLETPC
is 86. The method returns True or nonzero if the Microsoft Windows XP
Tablet
PC Edition operating system is running; False or zero otherwise.

Applications should not rely on a true or nonzero value to mean all
Tablet
PC components are installed and working. See the following question for
details on how to determine if Tablet PC components are installed.

</quote>

There is also a MediaCenter system metrics value.

I would expect System.Windows. Forms.SystemInf ormation would list both
values
as it gives most other SystemMetrics, however it appears to be missing
TabletPC (SM_TABLETPC) & MediaCenter (SM_MEDIACENTER ).

You can use code similar to:

Public Enum SystemMetric As Integer
TabletPC = 86
MediaCenter = 87
End Enum

Declare Auto Function GetSystemMetric s Lib "User32" (ByVal index As
SystemMetric) As Integer

If GetSystemMetric s(SystemMetric. TabletPC) <> 0 Then
Debug.WriteLine ("On a Tablet PC")
Else
Debug.WriteLine ("Not on a Tablet PC")
End If

If GetSystemMetric s(SystemMetric. MediaCenter ) <> 0 Then
Debug.WriteLine ("On a Media Center PC")
Else
Debug.WriteLine ("Not on a Media Center PC")
End If

I've used the Tablet PC value reliably, I don't have a Media Center PC to
verify the Media Center value.

I'm not sure how to tell the difference between Home & Pro.

Hope this helps
Jay
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
| Thanks, but it gives me the version of windows running, 95, 98, 2000,
xp,
| 2003, etc, but it doesn't tell me if the Windows edition is server or
| workstation, even the build numbers are the same for both(if I'm not
| mistaken). Whether it is win9x, 2000, xp or 2003 doesn't matter to me,
I
| just want to know if it's workstation(or home, or pro) or server.
|
| Is there another way to know? (by a method, a property or even a
registry
| key)
|
| Thanks
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans
| le message de news: Ok************* *@TK2MSFTNGP10. phx.gbl...
| > ThunderMusic,
| > Have you looked at System.Environm ent.OSVersion?
| >
| > For details see:
| > http://support.microsoft.com/kb/304289
| >
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
| > news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| > | Hi,
| > | How can I get if the Windows running is a server version?
| > |
| > | Is there a property somewhere that can tell me if the Windows
version
is
| > a
| > | server edition (including server, advanced server, web server, etc)
or
| > just
| > | a workstation (if it's not a workstation, then it's a server). My
app
| > must
| > | verifies that for security reasons. It should work from at least
windows
| > | 2000 (Windows 98 and ME, would appreciated to, but if it's not
possible,
| > | I'll put it in the system requirements)
| > |
| > | Thanks
| > |
| > | ThunderMusic
| > |
| > |
| >
| >
|
|


Oct 18 '05 #9
Well actually this topic has been covered by dr GUI ( MSDN ) somewhere in
2002 :-)

here is the article

http://msdn.microsoft.com/library/de...ui06042002.asp

it will even show the sort of server the proggy is running on small busines
server etc etc

regards

Michel Posseth [MCP]


"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > schreef in bericht
news:uk******** *****@tk2msftng p13.phx.gbl...
ok, you lead me on a good path, but the information is not in
GetSystemMetric s. Instead, I found it in the GetVersionEx function I got
from the System Information Functions link at the bottom of the page.

So for those who want to know, the information is in GetVersionEx using a
pointer of type OSVERSIONINFOEX , you can get the information into the
wProductType property. It can be one of the following values :
VER_NT_WORKSTAT ION, VER_NT_DOMAIN_C ONTROLLER or VER_NT_SERVER.

Now, all I have to do is find a way to access this function from within my
.net app (I never worked with win32 APIs from within .NET before. Anybody
have a link to get me on the right track? (I know there are many many many
examples on the web, I will probably find one suitable before anyone post
here, but if I don't.....))

Thanks a lot

ThunderMusic

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans le message de news: un************* *@TK2MSFTNGP14. phx.gbl...
ThunderMusic,
The only other options I can think of is GetSystemMetric s, however after
a
quick look I don't see a SM_SERVER value (just a SM_SERVERR2 for Windows
Server 2003 "R2" value).

I know MSDN Magazine (http://msdn.microsoft.com/msdnmag) has a topic
every
once in a while on getting the "real" OS you are on, however I don't see
one
right now.
Here is some info on use GetSystemMetric s from an earlier post of mine:

According to the Microsoft Tablet PC SDK:

<quote>
Q. How can I determine if my application is running on a Tablet PC?
A. Use the Windows GetSystemMetric s API and pass in SM_TABLETPC as the
value
of the index. SM_TABLETPC is defined in Winuser.h. The value of
SM_TABLETPC
is 86. The method returns True or nonzero if the Microsoft Windows XP
Tablet
PC Edition operating system is running; False or zero otherwise.

Applications should not rely on a true or nonzero value to mean all
Tablet
PC components are installed and working. See the following question for
details on how to determine if Tablet PC components are installed.

</quote>

There is also a MediaCenter system metrics value.

I would expect System.Windows. Forms.SystemInf ormation would list both
values
as it gives most other SystemMetrics, however it appears to be missing
TabletPC (SM_TABLETPC) & MediaCenter (SM_MEDIACENTER ).

You can use code similar to:

Public Enum SystemMetric As Integer
TabletPC = 86
MediaCenter = 87
End Enum

Declare Auto Function GetSystemMetric s Lib "User32" (ByVal index As
SystemMetric) As Integer

If GetSystemMetric s(SystemMetric. TabletPC) <> 0 Then
Debug.WriteLine ("On a Tablet PC")
Else
Debug.WriteLine ("Not on a Tablet PC")
End If

If GetSystemMetric s(SystemMetric. MediaCenter ) <> 0 Then
Debug.WriteLine ("On a Media Center PC")
Else
Debug.WriteLine ("Not on a Media Center PC")
End If

I've used the Tablet PC value reliably, I don't have a Media Center PC to
verify the Media Center value.

I'm not sure how to tell the difference between Home & Pro.

Hope this helps
Jay
--
Hope this helps
Jay [MVP - Outlook]
T.S. Bradley - http://www.tsbradley.net
"ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
| Thanks, but it gives me the version of windows running, 95, 98, 2000,
xp,
| 2003, etc, but it doesn't tell me if the Windows edition is server or
| workstation, even the build numbers are the same for both(if I'm not
| mistaken). Whether it is win9x, 2000, xp or 2003 doesn't matter to me,
I
| just want to know if it's workstation(or home, or pro) or server.
|
| Is there another way to know? (by a method, a property or even a
registry
| key)
|
| Thanks
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> a écrit
dans
| le message de news: Ok************* *@TK2MSFTNGP10. phx.gbl...
| > ThunderMusic,
| > Have you looked at System.Environm ent.OSVersion?
| >
| > For details see:
| > http://support.microsoft.com/kb/304289
| >
| >
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "ThunderMus ic" <NO.danlat.at.h otmail.com.SPAM > wrote in message
| > news:OW******** ******@TK2MSFTN GP09.phx.gbl...
| > | Hi,
| > | How can I get if the Windows running is a server version?
| > |
| > | Is there a property somewhere that can tell me if the Windows
version
is
| > a
| > | server edition (including server, advanced server, web server, etc)
or
| > just
| > | a workstation (if it's not a workstation, then it's a server). My
app
| > must
| > | verifies that for security reasons. It should work from at least
windows
| > | 2000 (Windows 98 and ME, would appreciated to, but if it's not
possible,
| > | I'll put it in the system requirements)
| > |
| > | Thanks
| > |
| > | ThunderMusic
| > |
| > |
| >
| >
|
|


Oct 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4455
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what I am currently doing: When I run sqlservr.exe I see the following: 2003-12-19 15:51:28.20 server Microsoft SQL Server 2000 - 8.00.760 (Intel X8 6)
0
2890
by: Stefan Hinz | last post by:
Degan, jumping in to try and solve some problems that look pretty obvious to me ... > #options for default service (mysqld2) > (mysqld2) It should be , not (mysqld2).
2
15226
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000 Personal disk from the SQL Server 2000 Enterprise kit as this is reported here on the MSDN web site to be the version that is supported on Windows XP. In fact so many of you kind people confess to having succeeded in doing it. I have tried...
10
388
by: ThunderMusic | last post by:
Hi, How can I get if the Windows running is a server version? Is there a property somewhere that can tell me if the Windows version is a server edition (including server, advanced server, web server, etc) or just a workstation (if it's not a workstation, then it's a server). My app must verifies that for security reasons. It should work from at least windows 2000 (Windows 98 and ME, would appreciated to, but if it's not possible, I'll...
3
7488
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
17
5098
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1 framework). I can however view other ASP.NET 1.1 sites on my local Windows XP machine. It's only the...
0
3002
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the following command line: caspol.exe -polchgprompt off -machine -addgroup 1 -url "file://<UNC path to dll>\mixedMode.dll" FullTrust ame "GroupName" -polchgprompt on
10
2162
by: deathtospam | last post by:
My employer is starting to take the first steps towards migrating its Classic ASP codebase to ASP.NET v2.0. We have a copy of our existing website on the new Windows Server 2003 R2 test server, and everything is running fine. However, when I create a simple "HelloWorld.aspx" file, then browse to the page from VS.NET 2005 on the same machine, I get the following error message: ================================================ Server...
0
8959
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8784
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6049
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4558
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4821
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2187
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.