Hello,Here is a copy of code I use to detect the difference.
Regards,
Brad
$server=0
? "Determining the OS type and setting the command variable."
If @INWIN=1 ; INWIN returns a 1 if being run from Windows NT
$OS="Windows NT"
; If logging in from Windows NT, check to see if you are on a Server or a
; Workstation. The key:
; HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType
; has the following three possible values:
; WinNT if on a workstation
; ServerNT if on a server
; LanmanNT if on a domain controller (primary or backup)
; Right now, we are only concerned if the computer is a server. So,
$key="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions"
$WksType=ReadValue($key,"ProductType")
$returncode=@ERROR
If $returncode>0
? "There was an error reading: "+$key+"\ProductType"
? "The error number is: "+$returncode
Else
If (($WksType = "LanmanNT") or ($WksType = "ServerNT"))
$server=1
Endif
Endif
$comd="@LANROOT\cmd.exe /c "
Else
$key=$loc+"Microsoft\Windows\CurrentVersion\Setup"
$WinDir=ReadValue($key,"WinDir")
; Will set the OS variable to Win9x. If neccesary to check for difference between
; Win95 and Win98 later, @DOS will report 4.0 for Win95 and 4.1 for Win98
$OS="Win9x"
$comd="$WinDir\command.com /c "
Endif
? "This system is: "+$OS