Dear,There are many versions of windows. For that reason we create some
code.
The result is not only the different between 95 or nt,
but it will return a $os variable with the value.
Our script is:
code:
IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
;
$os=""
$os_dos=@dos
SELECT
CASE ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 -
$os="W2K"
CASE ($NT_mode = "yes") ; - Windows NT -
$os="NT4"
CASE ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME -
$os="ME"
CASE ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 -
$os="W98"
CASE ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 -
$os="W95"
CASE 1
$os="???" ; - undetermined -
ENDSELECT
$os=LTRIM(RTRIM(substr($os+" ",1,3)))
;
? "os "+$os
Possible output: W2K, NT4, ME, W98, W95, or ???.
In your code you can you this variable.
f.e.
code:
SELECT
CASE ($os = "W2K")
; things to do for windows 2000
CASE ($os = "ME")
; things to do for windows ME
CASE 1
; things to do for all other windows versions.
ENDSELECT
For your server check you can use following code
code:
$os_product=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
SELECT
CASE (@inwin = 1) AND ($os_product <> "WinNT") AND (@dos = "5.0") ; - Windows 2000 -
$server="W2K_Server"
CASE (@inwin = 1) AND ($os_product = "LANMANNT") ; - Windows NT -
$server="NT4_Domain_Controller"
CASE (@inwin = 1) AND ($os_product = "ServerNT") ; - Windows NT -
$server="NT4_Member_Server"
CASE 1
$server="no"
ENDSELECT
The variable $server contains no or the name of the server.Greetings.
------------------
Site map: