OS Detection



Any hints for an SMS Installer script to detect which OS is running now that
Vista is here? I have the bits for lots of previous OSs. Thanks.

item: Remark
Text=.
end
item: Remark
Text=Figure out what version of Windows is running.
end
item: Remark
Text=.
end
item: Get System Information
Variable=WINVER
Flags=00000001
end
item: Parse String
Source=%WINVER%
Pattern=.
Variable1=MAJOR
Variable2=MINBLD
end
item: Parse String
Source=%MINBLD%
Pattern=.
Variable1=MINOR
Variable2=BUILDNO
end
item: Check Configuration
Flags=10100000
end
item: Get System Information
Variable=NTSPNUM
Flags=00010010
end
item: If/While Statement
Variable=MAJOR
Value=3
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows NT 3.51
end
item: Else Statement
end
item: If/While Statement
Variable=MAJOR
Value=4
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows NT 4.0
end
item: Else Statement
end
item: If/While Statement
Variable=MAJOR
Value=5
end
item: If/While Statement
Variable=MINOR
Value=0
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 2000
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=1
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows XP
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=2
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows Server 2003
end
item: Else Statement
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Unknown Windows NT
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=0
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 95
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=10
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 98
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=90
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows ME
end
item: Else Statement
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Unknown Windows 9x
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: Get Registry Key Value
Variable=CSD
Key=SOFTWARE\Microsoft\Windows NT\CurrentVersion
Value Name=CSDVersion
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Workstation
end
item: Check Configuration
Flags=10100000
end
item: Get Registry Key Value
Variable=NTTYPE
Key=SYSTEM\CurrentControlSet\Control\ProductOptions
Value Name=ProductType
Flags=00000100
end
item: If/While Statement
Variable=NTTYPE
Value=ServerNT
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: Else Statement
end
item: If/While Statement
Variable=NTTYPE
Value=Terminal Server
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: Else Statement
end
item: If/While Statement
Variable=NTTYPE
Value=LanmanNT
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end


.



Relevant Pages

  • Re: Secondary DNS and PIX
    ... in SBS SP1 you can substitute Windows Server SP2 and Exchange SP2 for the earlier versions, you do not need to back out of current levels. ... Change the value of the DisableTaskOffload registry key to ...
    (microsoft.public.windows.server.sbs)
  • Re: Secondary DNS and PIX
    ... WINDOWS SERVER 2003 FOR SMALL BUSINESS SERVER, ... Windows SBS 2003 SP1 is available. ... Change the value of the DisableTaskOffload registry key to ...
    (microsoft.public.windows.server.sbs)
  • Re: SMTP authentication for BT Yahoo and OE 6
    ... I follow the backup plan (I have Windows XP) I get to the directory: ... I select the registry key, ... > Outlook Express Does Not Save the Mail Server Logon Password ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Cant Access Registry
    ... I have designed a software audit tool which loops through ... registry key but the problem is that on every pc but the ... Windows 2000 to Windows 2003 Server. ...
    (microsoft.public.vb.general.discussion)
  • RE: Reserved Ports
    ... installation that breaks the Cluster Service in Windows Server 2003. ... If you need Lotus Domino Server to co-exist with Cluster Services, ... The workaround is to delete the following registry key: ... Windows 2000 MCSE + MCDBA ...
    (microsoft.public.windows.server.clustering)