if
(
exists wmi AND
(
not
(
name of operating system = "WinME"
)
)
)
then
(
string value of selects "caption from win32_operatingsystem" of wmi & " " & csd version of operating system
)
else
(
"Windows " &
(
following text of first "Win" of
(
name of operating system as string
)
)
&
(
if
(
name of operating system = "WinNT"
)
then
(
(
if
(
exists key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" whose
(
exists value "ProductType" of it AND
(
value "ProductType" of it as string as lowercase = "servernt" OR value "ProductType" of it as string as lowercase = "lanmannt"
)
)
of registry
)
then
(
if
(
exists key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" whose
(
exists value "ProductSuite" of it AND value "ProductSuite" of it as string as lowercase contains "terminal"
)
of registry
)
then " Terminal Server" else " Server"
)
else " Workstation"
)
& " " & csd version of operating system
)
else
(
if
(
name of operating system = "Win98"
)
then
(
if
(
csd version of operating system as string contains "A"
)
then " Second Edition" else ""
)
else
(
if
(
name of operating system = "Win95"
)
then
(
if
(
csd version of operating system as string contains "C" OR csd version of operating system as string contains "B"
)
then " OSR2" else ""
)
else " " & csd version of operating system
)
)
)
)
if (exists wmi AND (not (name of operating system = "WinME" ))) then (string value of selects "caption from win32_operatingsystem" of wmi & " " & csd version of operating system) else ( "Windows " & (following text of first "Win" of (name of operating system as string)) & (if (name of operating system = "WinNT" ) then ((if (exists key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" whose (exists value "ProductType" of it AND (value "ProductType" of it as string as lowercase = "servernt" OR value "ProductType" of it as string as lowercase = "lanmannt" )) of registry) then (if (exists key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" whose (exists value "ProductSuite" of it AND value "ProductSuite" of it as string as lowercase contains "terminal" ) of registry) then " Terminal Server" else " Server" ) else " Workstation" ) & " " & csd version of operating system) else (if (name of operating system = "Win98" ) then (if (csd version of operating system as string contains "A" ) then " Second Edition" else "" ) else (if (name of operating system = "Win95" ) then (if (csd version of operating system as string contains "C" OR csd version of operating system as string contains "B" ) then " OSR2" else "" ) else " " & csd version of operating system ))))