Page 1 of 1 1
Topic Options
#212584 - 2017-07-13 07:49 PM Check OS version
OgeccuT Offline
Just in Town

Registered: 2017-07-13
Posts: 2
Loc: USA
I am new to KIX and just trying to figure this out.

I need to work with an existing script that I have not seen yet.
But I am told that I will need to exit if the OS is windows 10.

IF @PRODUCTTYPE = "Windows 10 Enterprise (N)"
Exit 0

Will this code in the begging of the script get me what I need?

A side question? Is there a way to test this? Do I need a compiler installed or I can run code from cmd?
Thank you for the help.



Edited by OgeccuT (2017-07-13 07:50 PM)

Top
#212586 - 2017-07-13 09:50 PM Re: Check OS version [Re: OgeccuT]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
There are examples of this scattered throughout the board over the years, but finding them can sometime be tough. Depending on your needs...

most basic would be
 Code:
if instr(@producttype,"Windows 10")
  exit 0
endif


Or with a Select Statement...
 Code:
Select 
  Case instr(@producttype,"Windows 7")
    ;do stuff
  Case instr(@producttype,"Windows 8")
    ;do stuff
  Case 1
    ? "OS not covered"
    Exit 0
Endselect


Create a copy of your script and rename it. Then you can easily test it without worry of effecting production code.



Top
#212590 - 2017-07-14 09:56 AM Re: Check OS version [Re: OgeccuT]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: OgeccuT

....
A side question? Is there a way to test this? Do I need a compiler installed or I can run code from cmd?
....


You do not need a compiler. Kix code can be written in a simple text editor like Notepad but a little more advanced editor like Notepad++ can make it easier depending on your needs.

You can start the script from a command line.
 Code:
D:\somefolder\kix32.exe D:\somefolder\script.kix
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#212592 - 2017-07-14 03:06 PM Re: Check OS version [Re: Mart]
OgeccuT Offline
Just in Town

Registered: 2017-07-13
Posts: 2
Loc: USA
Big Thank you for your answers. I downloaded KiX2010.466, that was the latest one I could find.
As soon as I will get the script I need to modify will try it out.

And now will try to do some testing with just echo depending on the OS.

Thank you.

Top
#212594 - 2017-07-14 04:55 PM Re: Check OS version [Re: OgeccuT]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
4.67 is available in the downloads section
http://www.kixtart.org/binary/distrib/KiX2010_467.zip
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

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
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.056 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

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