Looks like a slightly modified version of mine. Glad someone can make
use of it.
Nick.
> -----Original Message-----
> Posted At: 11 January 2000 23:30
> Posted To: microsoft.public.scripting.wsh
> Conversation: How do I differentiate between NT Workstation and NT
> Server
> Subject: Re: How do I differentiate between NT Workstation
> and NT Server
> The script below will return the OS for all Win9x (?, there
> may be some
> 95b strings I haven't found yet)& NT40 boxes, won't handle W2k but it
> could if you know the correct string to check for. It also determines
> if server is DC. I took most of it from a script on Clarence's site,
> unfortunately I can't credit the author at the moment. HTH.
> 'Function: GetOS
> 'Description: Determine OS by reading reg val & comparing to known
> values
> Function GetOS()
> Dim osShell, strOS
> On Error Resume Next
> Err.Clear
> Set OsShell = CreateObject("Wscript.Shell")
> strOS =
> OsShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\C
> ontrol\ProductOptions\ProductType")
> If Hex(err)="80070002" Then
> Err.Clear
> strOS =
> OsShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> \CurrentVersion\VersionNumber")
> If err<> 0 Then
> GetOS = Null
> Exit Function
> End if
> End If
> Select Case strOS
> Case "LanmanNT"
> strOpSystem = "NT4DC"
> Case "ServerNT"
> strOpSystem = "NT4SRVR"
> Case "WinNT"
> strOpSystem = "NT4WS"
> Case "4.00.950"
> strOpSystem = "Win95A"
> Case "4.00.1111"
> strOpsystem = "Win95B"
> Case "4.03.1214"
> strOpSystem = "Win95B"
> Case "4.10.1998"
> strOpSystem = "Win98"
> Case "4.10.2222"
> strOpSystem = "Win98SE"
> Case Else
> MsgBox "Error determing the OS. Please contact
> " & strSysAdmin1 & "or
> " & strSysAdmin2 & "." & vbcrlf & _
> "after
> recording this error message exactly."
> End Select
> Set osShell = Nothing
> End Function
> > Anyone know if there is a way to tell whether the machine
> is running NT
> > Server or NT Workstation via some object or method?
> > Thanks.