Page 1 of 1 1
Topic Options
#19794 - 2002-04-11 05:16 PM determine os version
jhdvy Offline
Fresh Scripter

Registered: 2002-03-22
Posts: 44
Loc: New Jersey
I had this running in a script to determine the OS. Now that is switched from kixtart 3.63 4.02 it doesn't work anymore. I know there are a lot of ways to do this but some are way too long. I just want to simply know the OS type.

Here is what I have:

Select
Case ((@INWIN = 1) And (@DOS = 5.0))
$OS = "Win2K"
Case ((@INWIN = 1) And (@DOS = 4.0))
$OS = "WinNT4"
Case ((@INWIN = 2) And (@DOS >= 4.10))
$OS = "Win98"
Case ((@INWIN = 2) And (@DOS = 4.0))
$OS = "Win95"
EndSelect

"Running""$os"

On 3.62 the output wass fine. On 4.02 I get $os as the output.

Thanks

Top
#19795 - 2002-04-11 05:25 PM Re: determine os version
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
I didn't test this on Win98, but try this...

? "[ @INWIN ][ @DOS ]"
? ""

SELECT
CASE((@INWIN = "1") And (@DOS = "5.0"))
$OS = "Win2K"
CASE((@INWIN = "1") And (@DOS = "4.0"))
$OS = "WinNT4"
CASE((@INWIN = "2") And (@DOS > "4.0"))
$OS = "Win98"
CASE((@INWIN = "2") And (@DOS = "4.0"))
$OS = "Win95"
ENDSELECT
? "Running " + "$os"
? ""

Rocco

[ 11 April 2002, 17:31: Message edited by: Rocco Capra ]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#19796 - 2002-04-11 05:25 PM Re: determine os version
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Try this:
code:
Select
Case ((@INWIN = 1) And (@DOS = 5.0))
$OS = "Win2K"
Case ((@INWIN = 1) And (@DOS = 4.0))
$OS = "WinNT4"
Case ((@INWIN = 2) And (@DOS >= 4.10))
$OS = "Win98"
Case ((@INWIN = 2) And (@DOS = 4.0))
$OS = "Win95"
EndSelect

? 'Running ' + $os

Also, take a look at the @PRODUCTTYPE, that'll give you a little bit more granularity

[ 11 April 2002, 17:28: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#19797 - 2002-04-11 05:29 PM Re: determine os version
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The @DOS macro returns a text string so put quotes around your numbers like @DOS = "5.0".

You may also want to add a "CASE 1" at the end of your select to catch any unexpected data.

[ 11 April 2002, 17:54: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#19798 - 2002-04-11 05:52 PM Re: determine os version
jhdvy Offline
Fresh Scripter

Registered: 2002-03-22
Posts: 44
Loc: New Jersey
Thanks everyone!!
Top
#19799 - 2002-04-14 06:25 AM Re: determine os version
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

A more complete script can be:
code:
  $os=""
SELECT
CASE (@inwin = 1) AND (@dos = "5.1") ; - Windows XP -
$os="XP"
CASE (@inwin = 1) AND (@dos = "5.0") ; - Windows 2000 -
$os="W2K"
CASE (@inwin = 1) ; - Windows NT -
$os="NT4"
CASE (@inwin <> 1) AND (@dos = "4.90") ; - Windows ME -
$os="ME"
CASE (@inwin <> 1) AND (@dos = "4.10") ; - Windows 98 -
$os="W98"
CASE (@inwin <> 1) AND (@dos = "4.0") ; - Windows 95 -
$os="W95"
CASE 1
$os="???" ; - undetermined -
ENDSELECT
? "$$os "+$os

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#19800 - 2002-04-18 02:55 AM Re: determine os version
netixpc Offline
Fresh Scripter

Registered: 2002-02-13
Posts: 19
Loc: Lausanne - Switzerland
Use the new @producttype command available in KIX v4.x.

It's really more simple than the @inwin and @dos in the script. Try:

IF @PRODUCTTYPE = "Windows 95"
Blah, Blah...
ENDIF

There is a list of @PRODUCTTYPE in the KIX manual.
_________________________
SAVE THE WORLD - PROTECT THE PLANET

Top
Page 1 of 1 1


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.058 seconds in which 0.024 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