OS and Software Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > OS and Software >

 OS and Software Operations

IOS. / NOS. - If-Operating System

Previous Top Next


 

MiniRobotLanguage (MRL)

 

IOS. Conditional Statement

If Operating System

 

 

Intention

 

Conditional Statement. Test if the actual system meets the OS criteria you can specify. This way you can tell your script to do something else on different OS.

Usage is very simple. You just write IOS. and the OS you want to test for.

 

IOS.Win7

 DBP. We are in Windows 7!

EIF.

 

Also, you can specify multiple OS you want to support.  In this case you just write them all separated by a comma.

 

IOS.WinXP,Vista,Win2K

 DBP. We are here.

EIF.

 

But life is not always so simple. Maybe your script will only run on anything below Windows Vista?  In this case you just write

 

IOS.<Vista

 DBP. We are below Windows Vista

EIF.

 

And if Windows Vista is included, you can add a "=".

 

IOS.<=Vista

 DBP. We are below Windows Vista or in Vista.

EIF.

 

All of these features can be combined, for those seldom cases when needed. In this case Windowx XP and WIndows Vista would not be served.

 

IOS.=>Win7,<Win2K

 DBP. We are not in WinXP.

EIF.

 

Also instead of writing a OS-Name, you can use the OS number (below) and prefix it with a #Sign. Like this.

 

IOS.<#11

 DBP. We are below Windows Vista

EIF.

 

You can also use the command to check if the OS is x64 or not. Please do not combine this with other features:

 

IOS.x64

 DBP. Yes its x64

EIF.

 

 

The negative Form of this statement is NOS.

 

 

Syntax:

 

IOS.P1

' Block is executed if condition is met.

ELS.

' Block is executed if condition is not met.

EIF.

 

Parameter Explanation:

 

P1 - (optional) can be:

 

For Windows 2000:

   "windows 2000","w2k","win2000","win2k","w2000"

 

For Windows XP:

   "winxp","wxp","xp","windows xp","win xp"

 

For Window 2003:

   "windows 2003 server","ws2003","w2003"

 

For Windows Vista

   "windows vista","vista"

 

For Windows 7:

   "windows 7","w7","win7"

 

For Windows 8:

   "windows 8","w8","win8"

 

For Windows 9:

   "windows 9","w9","win9"

 

For Windows 10:

   "windows 10","w10","win10"

 

For Windows 3.1:

  "windows 3.1","w31"

 

For Windows 95:

   "windows 95","win95","w95"

 

For Windows 98:

   "windows 98","win98","w98"

 

For Windows ME:

   "windows me","winme","me"

 

For Windows NT 3:

   "windows nt 3","win nt3","nt3"

 

For Windows NT 3.1:

   "windows nt 3.1","win nt31","nt31"

 

For Windows NT 4:

   "windows nt 4","nt4","win nt4"

 

For any Windows NT:

   "windows nt","nt","win nt"

 

For any Windows 9x:

   "windows 9x","win9x","9x","w9x"

 

You can prefix the OS version with these Signs:

 

> - later then

= - equal

< - earlier then

 

to specify that all OS versions before or after an specified OS version are Ok.

 

IOS.<=Win7

 DBP. We are under Win7 or below!

EIF.

 

You can also specify a number for the OS. In that case prefix the number with a "#". Do not use spaces between the number and the "#".The syntax is  #(number of OS).

Here are the numbers for the OS-versions.

 

1  - Windows 3.1

2  - Windows 95

3  - Windows 98

4  - Windows ME

5  - Windows NT 3

6  - Windows NT 3.1

7  - Windows NT 4

8  - Windows 2000

9  - Windows XP

10 - Windows 2003

11 - Windows Vista

12 - Windows 7

13 - Windows 8

14 - Windows 9

15 - Windows 10

 

For example: #9 will be Windows XP.

#12 would be Windows 7.

 

' You could write

IOS.#12,#9

 PRT. We're running Windows 7 or WinXP!

EIF.

 

' which is functional the same like if you write

IOS.Win7,XP

 PRT. We're running Windows 7 or WinXP!

EIF.

 

You can use this special feature to check if you are running under WOW64 (x64 Windows)

 

IOS.x64

 DBP. We are running on a x64 OS.

EIF.

 

 

 

Example:

 

'**********************************************

' IOS-Example

'**********************************************

'

IOS.VISTA,XP

 MBX. We're running VISTA or WinXP!

EIF.

 

'-------------------------

END.

 

 

'**********************************************

' IOS-Example

'**********************************************

'

GOS.x64

DBP.$$000

DBP.$$000

IOS.x64

 DBP.Ja

EIF.

ENR.

 

 

 

Remarks:

 

-

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    1.6.1. Program Flow Control

    GOS. - Get OS Information