#37827 - 2003-03-14 02:07 PM
Re: More than one IF INGROUP statement
|
maverick747
Lurker
Registered: 2003-03-13
Posts: 3
|
Thanks for answering, but the reason for my problem was me being stupid!
I had copied a kix-script from someone else and used it as a template for my own scripts. The mistake was that in the bottom of this script, just before EXIT, the following command was added:
:END
I cannot find the :END command in the KIX -reference /documentation, but still it seems that it makes the KIX-process stop (and don't return to the primary script to read subsequent IF INGROUP -commands). SO IF YOU FIND ":END" -in your scripts and don't know exactly what it's doing there; REMOVE IT!
Also, the SELECT /CASE INGROUP / ENDSELECT also works the same way as IF INGROUP / ENDIF. So, now I have successfully tested the following 2 options for running commands related to several group memberships (the * -lines are only used here to separate the different scripts):
Commands in the primary.kix -script: ******************************************
? Adding all network printers for all users If ADDPRINTERCONNECTION ("\\server1\hp laserjet 4") = 0 If ADDPRINTERCONNECTION ("\\server1\hp lj4 serverroom") = 0 If ADDPRINTERCONNECTION ("\\server2\Colorprinter ") = 0 Endif
? Checking for group memberships in primary.kix IF INGROUP("MICRO EXCHANGE-FAD") CALL "Micro Exchange.kix" ENDIF IF INGROUP("FTP Users") CALL "FTP Users.kix" ENDIF IF INGROUP("AccessIMAGES-PPB") CALL "IMAGES.kix" ENDIF
EXIT ***********************
or
*********************** ? Adding all network printers for all users If ADDPRINTERCONNECTION ("\\server1\hp laserjet 4") = 0 If ADDPRINTERCONNECTION ("\\server1\hp lj4 serverroom") = 0 If ADDPRINTERCONNECTION ("\\server2\Colorprinter ") = 0 Endif
Commands in the primary .kix -script: SELECT CASE INGROUP("MICRO EXCHANGE-FAD") CALL "Micro Exchange.kix" ENDSELECT SELECT CASE INGROUP("FTP Users") CALL "FTP Users.kix" ENDSELECT SELECT CASE INGROUP("AccessIMAGES-PPB") CALL "IMAGES.kix" ENDSELECT
EXIT *********************
Commands in Micro Exchange.kix script read: ************************ ? Map drives for the MICRO EXCHANGE-FAD group use k: "\\SERVER1\EXCHANGE"
? Select default printer for the MICRO EXCHANGE-FAD group If SetDefaultPrinter ("\\server1\hp laserjet 4") = 0 Endif
EXIT ************************
FTP Users.kix script read: ************************** ? Map drives for the FTP Users group use l: "\\SERVER1\FTP"
? Select default printer for the FTP Users group If SetDefaultPrinter ("\\server1\hp lj4 serverroom") = 0 Endif
EXIT **************************
IMAGES.kix script read: ***************************** ? Map drives for the FTP Users group use m: "\\SERVER1\IMAGES"
? Select default printer for the FTP Users group If SetDefaultPrinter ("\\server2\Colorprinter") = 0 Endif
EXIT ***************************
Now a user who is member of all groups gets all drive mappings; k:, l: and m: (and the default printer from the first subscript)!
FINALLY A QUESTION TO SEALEOPARD: If Im going to use an .INI -file, how should I call that file from a .KIX -script?
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 648 anonymous users online.
|
|
|