Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: NT Server NT Workstation
Most machine commonly referred to as Workstations or servers run both services, and thus they are indistinguishable by the wntServerList function.
If you want the "role" the machine is set up for, a "Server" role or a "Workstation" role, you have to peer into the machine's registry (do you have security privileges?), e.g.,
----------------------------------------------------------
From Microsoft Database:
Determining System Version from a Win32-based Application
Last reviewed: May 2, 1996
In order to distinguish between Windows NT Workstation and Windows NT Server, use the registry API to query the
following:
----------------------------------------------------------
WIL Sample code
Article ID: Q92395
\HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet
\Control
\ProductOptions
The result will be one of the following:
WINNT Windows NT Workstation is running.
SERVERNT Windows NT Server (3.5 or later) is running.
LANMANNT Windows NT Advanced Server (3.1) is running.
ver = WinVersion(4)
if ver == 4 ;if NT
prodstring = ""
prodoptions=RegQueryValue(@RegMachine,"System\CurrentControlSet\Control\ProductOptions[ProductType]")
if StrUpper(prodoptions) == "WINNT"
prodstring = "Windows NT Workstation is running."
Endif
if StrUpper(prodoptions) == "SERVERNT"
prodstring = "Windows NT Server (3.5 or later) is running."
Endif
if StrUpper(prodoptions) == "LANMANNT"
prodstring = "Windows NT Advanced Server (3.1) is running."
Endif
Message("Product Option", prodstring)
Endif
Article ID: W13531
Filename: Distinguish between NT 4 Server and Workstation.txt
File Created: 2002:12:17:14:45:04
Last Updated: 2002:12:17:14:45:04