This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
Dell,
Try GetVersionEx. Have a look at the OSVERSIONINFOEX structure. It
contains all the info you may require.
Zyg
-----Original Message-----
From: Dell Setzer [mailto:xxxxx@panix.com]
Sent: December 1, 2000 12:01
To: NT Developers Interest List
Subject: [ntdev] Server vs Workstation
This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
You are currently subscribed to ntdev as: xxxxx@jetform.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
Use VerifyVersionInfo.
BOOL CheckProductType(INT_PTR nType)
{
OSVERSIONINFOEX verinfo;
INT64 dwConditionMask=0;
BOOL bResult=FALSE;
DWORD dwTypeMask = VER_PRODUCT_TYPE;
memset(&verinfo,0,sizeof(verinfo));
verinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
VER_SET_CONDITION(dwConditionMask,VER_PRODUCT_TYPE,VER_EQUAL);
switch (nType)
{
// W2K Professional
case 0:
verinfo.wProductType=VER_NT_WORKSTATION;
break;
// W2K Server
case 1:
verinfo.wProductType=VER_NT_SERVER;
break;
// W2K Advanced Server or Data Center
case 2:
verinfo.wProductType=VER_NT_SERVER;
verinfo.wSuiteMask =VER_SUITE_ENTERPRISE;
VER_SET_CONDITION(dwConditionMask,VER_SUITENAME,VER_OR);
dwTypeMask = VER_PRODUCT_TYPE | VER_SUITENAME;
break;
// W2k Data Center
case 3:
verinfo.wProductType=VER_NT_SERVER;
verinfo.wSuiteMask =VER_SUITE_DATACENTER;
VER_SET_CONDITION(dwConditionMask,VER_SUITENAME,VER_OR);
dwTypeMask = VER_PRODUCT_TYPE | VER_SUITENAME;
break;
// W2K Domain Controller
case 4:
verinfo.wProductType=VER_NT_DOMAIN_CONTROLLER;
break;
default:
verinfo.wProductType=VER_NT_WORKSTATION;
break;
}
return (VerifyVersionInfo(&verinfo,dwTypeMask,dwConditionMask));
}
-----Original Message-----
From: Dell Setzer [mailto:xxxxx@panix.com]
Sent: Friday, December 01, 2000 9:01 AM
To: NT Developers Interest List
Subject: [ntdev] Server vs Workstation
This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
Thanks, Zygmunt and Eliyas. Unfortunately, while OSVERSIONINFOEX will work
well for Windows 2000, it doesn’t seem to be supported in NT 4.0 (or am I
missing something?) Is there a way to tell Server from Workstation under
NT 4.0? Some registry setting, maybe?
…dell
-----Original Message-----
From: Zygmunt Wiercioch
Dell,
Try GetVersionEx. Have a look at the OSVERSIONINFOEX structure. It
contains all the info you may require.
Zyg
-----Original Message-----
From: Dell Setzer [mailto:xxxxx@panix.com]
This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
Try looking at the following registry value on NT 4.0:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
Value: ProductType
WinNT = Workstation
ServerNT = Server
It is also possible to detect Terminal Server by looking at the ProductSuite
value:
if it contains the string ‘Terminal Server’ then you are running on NT
4.0 Terminal Server
-----Original Message-----
From: Dell Setzer [mailto:xxxxx@panix.com]
Sent: 03 December 2000 23:26
To: NT Developers Interest List
Subject: [ntdev] RE: Server vs Workstation
Thanks, Zygmunt and Eliyas. Unfortunately, while OSVERSIONINFOEX will work
well for Windows 2000, it doesn’t seem to be supported in NT 4.0 (or am I
missing something?) Is there a way to tell Server from Workstation under
NT 4.0? Some registry setting, maybe?
…dell
-----Original Message-----
From: Zygmunt Wiercioch
Dell,
Try GetVersionEx. Have a look at the OSVERSIONINFOEX structure. It
contains all the info you may require.
Zyg
-----Original Message-----
From: Dell Setzer [mailto:xxxxx@panix.com]
This has probably come up before, but I’ll ask anyway: how can I
programatically determine whether I’m running on NT Server vs NT
Workstation? Also, the same question regarding the various flavors of
2000?
Thanks,
Dell Setzer
xxxxx@panix.com
—
You are currently subscribed to ntdev as: xxxxx@des.co.uk
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> Try looking at the following registry value on NT 4.0:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
Value: ProductType
WinNT = Workstation
ServerNT = Server
…server which is not a domain controller.
LanmanNT = Server which is domain controller.
In NT4, there are no ways of make a DC non-DC or a non-DC - DC, also there
are no ways of moving the DC to another domain. This can be done by
reinstall only.
Max
In NT4, there is no way using the std tools to do this, but there is at least one
3rd party program that does a promote/demote for NT4 server. Check out
http://www.u-tools.com/UTools/UPromote.asp
for more information.
Regards,
Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, December 04, 2000 8:53 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Server vs Workstation
Try looking at the following registry value on NT 4.0:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
Value: ProductType
WinNT = Workstation
ServerNT = Server
…server which is not a domain controller.
LanmanNT = Server which is domain controller.
In NT4, there are no ways of make a DC non-DC or a non-DC - DC, also there
are no ways of moving the DC to another domain. This can be done by
reinstall only.
How did we get from distinguishing NT Workstation and Servers apart
programmatically to promoting servers to BDC/PDC ??
This list really cracks me up sometimes
-----Original Message-----
From: Paul Bunn [mailto:xxxxx@UltraBac.com]
Sent: 04 December 2000 18:24
To: NT Developers Interest List
Subject: [ntdev] RE: Server vs Workstation
In NT4, there is no way using the std tools to do this, but there is at
least one
3rd party program that does a promote/demote for NT4 server. Check out
http://www.u-tools.com/UTools/UPromote.asp
for more information.
Regards,
Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, December 04, 2000 8:53 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Server vs Workstation
Try looking at the following registry value on NT 4.0:
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions
Value: ProductType
WinNT = Workstation
ServerNT = Server
…server which is not a domain controller.
LanmanNT = Server which is domain controller.
In NT4, there are no ways of make a DC non-DC or a non-DC - DC, also there
are no ways of moving the DC to another domain. This can be done by
reinstall only.
You are currently subscribed to ntdev as: xxxxx@des.co.uk
To unsubscribe send a blank email to $subst(‘Email.Unsub’)