Page 1 of 1 1
Topic Options
#48242 - 1999-09-29 11:01 AM Operation System Detection
Anonymous
Unregistered


How in Kixtart32 do you detect the operations system. I have a network with 1/2 95 and 1/2 NT. I need only certain parts of the login script to run, if the operating system is NT. and vise versa for 95.
Top
#48243 - 1999-09-29 03:21 PM Re: Operation System Detection
Anonymous
Unregistered


Here is my subroutine which pretty much covers it...
;-----------------------------------------------------------------
; SUBROUTINE: check_os
; Determines what operating system and type is running on the host
; RETURNS:
; $os "Windows 95" = Windows 95
; "Windows 98" = Windows 98
; "Windows NT" = Windows NT
; $NT_type "Server" = Server
; "Server Domain Controller" = Either an NT server PDC or BDC
;
;-----------------------------------------------------------------
:check_os

; Select statements don't seem to like using @INWIN and @DOS... hmm wtf
;$inwin_str = @INWIN
;$dos_str = @DOS

$NT_Type = "" ; default to nothing unless NT is detected

IF @INWIN = 1
?"Windows NT detected"
$os="Windows NT"
; Determine what type of Windows NT
$Rtn=ReadValue("hkey_local_machine\system\currentcontrolset\control\productoptions","producttype")
Select
Case $Rtn="WINNT"
; /* System is a Windows NT Workstation */
$NT_Type = "Workstation"
Case $Rtn="SERVERNT"
; /* System is running Windows NT Server (domain member) */
$NT_Type = "Server"
Case $Rtn="LANMANNT"
$NT_Type = "Server Domain Controller"
EndSelect
Endif

If @INWIN = 2
Select
Case @DOS = "4.0"
$os = "Windows 95"
? "Windows 95 detected"
Case @DOS = "4.10"
$os = "Windows 98"
? "Windows 98 detected"
EndSelect
Else
$os = "Unknown"
? "Unknown system type"
Endif
Return


Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.046 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org