Use a centralised INI file - look up the ReadProfileString() and WriteProfileString() functions in the manual.

Have a section of the file that looks like this:
Code:
[DEPARTMENTS]

ABCDepartment=1
DEFDepartment=0
GHIDepartment=1
...
department999=1



You can now use:
Code:

$sDepartment=Left(@WKSTA,1,Len(@WKSTA)-1)
$sComputerNo=Right(@WKSTA,3)

If ReadProfileString("Department.ini","DEPARTEMENTS",$sDepartment)
...Check JRE install here...
EndIf



You just need to set the value on the department key in the ini file to "1" to install, and "0" to not install. The default (if the department key does not exist) is to not install.

You should check the registry to see if the JRE exists rather than using a list, which will cater for machines that get it removed for any reason.

It you want to track the installs, then write the machine name back to the ini file with a timestamp as data like this:
Code:
$=WriteProfileString("Department.ini","INSTALLED",@WKSTA,@DATE+" "+@TIME)