Originally Posted By: Lonkero
ok... your ini-functions are rather complex for that purpose, given that simple few lines would do the logic in my opinion.

There are over 400 computers in each school that the ini files takes are of, without having to specify 400 sections for 400 machines in each ini. The goal was to have as few sections as possible in the INI. The part of the ini I pasted was only a sample. Here are the two main INIs in their entirety, for the junior and senior high--

junior high...
 Code:
; ========================================================
;                       FORMAT OF FILE
; ========================================================
;
; [computername-1]
; printer1=\\server\printer name     ;printer1 = Default Printer.  If you don't want to set (or change) their default printer then start with printer2.
; printer2=\\server\printer name     ;OPTIONAL: Extra network printers to add for all users (students included).  Add more with printer3, printer4, etc.
; building_printers=false            ;OPTIONAL: With this flag it will not add any printers from the [BUILDING_PRINTERS] section (applies to non-students only)
;
; [computername-1\username]          ;User Name Override -- This user will only read this section and not the regular section for the computer
; printer1=\\server\printer name
;
; [computername-*]                   ;Printer Settings apply to all machines with the prefix (* must be preceeded by the first dash)
; printer1=\\server\mono printer 1   ;NOTE: You can override this for a single machine by specifying the actual computer name in another section.
; printer2=\\server\mono printer 2
; printer3=\\server\color printer
;
; [ABC100-1 through ABC120-1]        ;Range such as [AJ100-1 through AJ120-1] or [AJLIB-1 through AJLIB-15] or [AJP14-* through AJP18-*].
;
; The script checks for priority in the most specific to least:
; [computername\username] > [computername-*\username] > [computername] > [computername-*] > [ABC100-1 through ABC120-1]
;
; ========================================================

[BUILDING_PRINTERS]
;Printers that get added to all NON-Students unless building_printers=false is specified.
printer1=\\AJH2\Library HPM551 (Color)
printer2=\\AJH2\Library HPP3010#1 (Mono)
printer3=\\AJH2\Library HPP3010#2 (Mono)
printer4=\\AJH2\RICOH Copier Guidance
printer5=\\AJH2\RICOH Copier Library
printer6=\\AJH2\RICOH Copier Mail Rm
printer7=\\AJH2\RICOH Special Ed
printer8=\\AJH2\Rm 116 Office
printer9=\\AJH2\Rm 136 Learning Center
printer10=\\AJH2\Rm 215 Office
printer11=\\AJH2\Rm 224 DE5100 (Color)
printer12=\\AJH2\Rm 224 DE5300 (Mono)
printer13=\\AJH2\Rm 230 DE5130cdn (Color)
printer14=\\AJH2\Rm 230 DE5350dn (Mono)
printer15=\\AJH2\Rm 242 Soc Studies Office
printer16=\\AJH2\Rm 253 HP 4050 (Mono)
printer17=\\AJH2\Rm 310 Office
printer18=\\AJH2\Rm 324 DE5100 (Color)
printer19=\\AJH2\Rm 324 DE5200 (Mono)
printer20=\\AJH2\Rm 342 English Office
printer21=\\AJH2\Rm C58 Classroom
printer22=\\AJH2\Rm C58 DE3010cn (Color)
printer23=\\AJH2\Rm P18 DE5350dn (Mono)
printer24=\\AJH2\Rm S102B Science Office


;RANGES
;=================

[AJ108-1 through AJ125-1]
printer1=\\ajh2\Rm 116 Office

[AJ136-*]
printer1=\\ajh2\Rm 136 Learning Center

[AJ128-1 through AJ157-1]
printer1=\\ajh2\Rm 136 Learning Center

[AJ208-1 through AJ225-1]
printer1=\\ajh2\Rm 215 Office

[AJ215-*]
printer1=\\ajh2\Rm 215 Office

[AJ234-1 through AJ265-1]
printer1=\\ajh2\Rm 242 Soc Studies Office

[AJ310-*]
printer1=\\ajh2\Rm 310 Office

[AJ308-1 through AJ325-1]
printer1=\\ajh2\Rm 310 Office

[AJ324-*]
building_printers=false
printer1=\\ajh2\Rm 324 DE5200 (Mono)
printer2=\\AJH2\Rm 324 DE5100 (Color)

[AJ330-1 through AJ363-1]
printer1=\\ajh2\Rm 342 English Office

[AJ351-*]
printer1=\\ajh2\Rm 351 DE2330dn (Mono)

[AJC51-1 through AJC60-1]
printer1=\\ajh2\Rm C58 Classroom

[AJC58-*]
printer1=\\ajh2\Rm C58 Classroom
printer2=\\AJH2\Rm C58 DE3010cn (Color)

[AJHEALTH-*]
printer1=\\asd11\JR Health Suite Dell 2330dn

[AJLIB-1 through AJLIB-15]
building_printers=false
printer1=\\AJH2\Library HPP3010#1 (Mono)
printer2=\\AJH2\Library HPP3010#2 (Mono)
printer3=\\AJH2\Library HPM551 (Color)

[AJLIB-16 through AJLIB-29]
building_printers=false
printer1=\\AJH2\Library HPP3010#2 (Mono)
printer2=\\AJH2\Library HPP3010#1 (Mono)
printer3=\\AJH2\Library HPM551 (Color)

[AJLIB-30 through AJLIB-33]
;teacher computers in back
printer1=\\AJH2\Library HPP3010#2 (Mono)

[AJM2-1 through AJM5-1]
printer1=\\ajh2\Rm C58 Classroom

[AJP14-* through AJP18-*]
printer1=\\ajh2\Rm P18 DE5350dn (Mono)

[AJS6-1 through AJS106-1]
printer1=\\ajh2\Rm S102B Science Office


;SPECIFIC MACHINES
;=================

[AJ111-1]
;guidance
building_printers=true

[AJ114-1]
;guidance
building_printers=true

[AJ210-1]
;reading chair
building_printers=true

[AJ216-1]
;guidance
building_printers=true

[AJ253-1]
;special ed room with printer in back
printer1=\\ajh2\Rm 253 HP 4050 (Mono)

[AJ316-1]
;guidance
building_printers=true

[AJ359-2]
;second computer in speech room
printer1=\\ajh2\Rm 342 English Office

[AJATTENDANCE]
printer1=\\asd11\AJ Records Dell 2330dn

[AJC59-1]
;art room (has local printer)
building_printers=true

[AJC100-1]
printer1=\\ajh2\Rm 116 Office

[AJC100-6]
printer1=\\ajh2\Rm 116 Office

[AJGUID-1]
;has local printer
building_printers=false
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid HP 1300n
printer4=\\asd11\AJ Guid Dell 2330dn
printer5=\\AJH2\RICOH Copier Mail Rm

[AJGUID-2]
building_printers=false
printer1=\\ajh2\RICOH Copier Guidance
printer2=\\asd11\AJ Guid HP 1300n
printer3=\\asd11\AJ Guid Dell 2330dn
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-B]
building_printers=false
printer1=\\asd11\AJ Guid HP 1300n
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid Dell 2330dn
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-C]
building_printers=false
printer1=\\ajh2\RICOH Copier Guidance
printer2=\\asd11\AJ Guid HP 1300n
printer3=\\asd11\AJ Guid Dell 2330dn
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-F]
building_printers=false
printer1=\\asd11\AJ Guid Dell 2330dn
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid HP 1300n
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-G]
building_printers=false
printer1=\\asd11\AJ Guid Dell 2330dn
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid HP 1300n
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-H]
building_printers=false
printer1=\\asd11\AJ Guid Dell 2330dn
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid HP 1300n
printer4=\\AJH2\RICOH Copier Mail Rm

[AJGUID-J]
building_printers=false
printer1=\\asd11\AJ Guid HP 1300n
printer2=\\ajh2\RICOH Copier Guidance
printer3=\\asd11\AJ Guid Dell 2330dn
printer4=\\AJH2\RICOH Copier Mail Rm

[AJC300-1]
printer1=\\ajh2\Rm 215 Office

[AJLIB-CIRC]
building_printers=false
printer1=\\AJH2\Library HPP3010#1 (Mono)
printer2=\\AJH2\Library HPP3010#2 (Mono)
printer3=\\AJH2\Library HPM551 (Color)
printer4=\\AJH2\Library Lab DE2330

[AJLIB-OFFICE1]
building_printers=false
printer1=\\AJH2\Library HPP3010#1 (Mono)
printer2=\\AJH2\Library HPP3010#2 (Mono)
printer3=\\AJH2\Library HPM551 (Color)
printer4=\\AJH2\Library Lab DE2330

[AJLIB-OFFICE2]
building_printers=false
printer1=\\AJH2\Library HPP3010#1 (Mono)
printer2=\\AJH2\Library HPP3010#2 (Mono)
printer3=\\AJH2\Library HPM551 (Color)
printer4=\\AJH2\Library Lab DE2330

[AJRECEP]
printer1=\\asd11\AJ Reception

[AJRECORDS]
printer1=\\asd11\AJ Records Dell 2330dn

[AJS3-1]
;ISS - has local
building_printers=true


senior high...
 Code:
; ========================================================
;                       FORMAT OF FILE
; ========================================================
;
; [computername-1]
; printer1=\\server\printer name     ;printer1 = Default Printer.  If you don't want to set (or change) their default printer then start with printer2.
; printer2=\\server\printer name     ;OPTIONAL: Extra network printers to add for all users (students included).  Add more with printer3, printer4, etc.
; building_printers=false            ;OPTIONAL: With this flag it will not add any printers from the [BUILDING_PRINTERS] section (applies to non-students only)
;
; [computername-1\username]          ;User Name Override -- This user will only read this section and not the regular section for the computer
; printer1=\\server\printer name
;
; [computername-*]                   ;Printer Settings apply to all machines with the prefix (* must be preceeded by the first dash)
; printer1=\\server\mono printer 1   ;NOTE: You can override this for a single machine by specifying the actual computer name in another section.
; printer2=\\server\mono printer 2
; printer3=\\server\color printer
;
; [ABC100-1 through ABC120-1]        ;Range such as [AJ100-1 through AJ120-1] or [AJLIB-1 through AJLIB-15] or [AJP14-* through AJP18-*].
;
; The script checks for priority in the most specific to least:
; [computername\username] > [computername-*\username] > [computername] > [computername-*] > [ABC100-1 through ABC120-1]
;
; ========================================================

[BUILDING_PRINTERS]
;Printers that get added to all NON-Students unless building_printers=false is specified.
printer1=\\ASH2\Library#1 DE5310 (Mono)
printer2=\\ASH2\Library#2 DE5310 (Mono)
printer3=\\ASH2\Library DE5100 (Color)
printer5=\\ASH2\Ricoh Copier Faculity Rm
printer6=\\ASH2\Ricoh Copier Mail Rm
printer7=\\ASH2\Rm 110 DE5100 (Color)
printer8=\\ASH2\Rm 110 HP4200 (Mono)
printer9=\\ASH2\Rm 121 HP4600 (Color)
printer10=\\ASH2\Rm 129C Science Office
printer11=\\ASH2\Rm 158 Classroom
printer12=\\ASH2\Rm 159 DE3000
printer13=\\ASH2\Rm 209 Math Office
printer14=\\ASH2\Rm 220 DE5100 (Color)
printer15=\\ASH2\Rm 220 DE5300 (Mono)
printer16=\\ASH2\Rm 220B English Office
printer18=\\ASH2\Rm 222#1 DE5300 (Mono)
printer19=\\ASH2\Rm 222#2 DE5300 (Mono)
printer20=\\ASH2\Rm 224 DE5310 (Mono)
printer21=\\ASH2\Rm 235 DE3000
printer22=\\ASH2\Rm 235 Special Ed Office
printer23=\\ASH2\Rm 256 World Lang Office
printer24=\\ASH2\Rm L4 DE5300 (Mono)
printer25=\\ASH2\Rm M106 Music
printer26=\\ASH2\Rm P215 Health
printer27=\\ASH2\Rm S10 Classroom
printer28=\\ASH2\Rm S101A Classroom
printer29=\\ASH2\Rm S106 DE3000


;RANGES
;=================

[AS113-1 through AS118-1]
printer1=\\ash2\Library#1 DE5310 (Mono)

[AS124-1 through AS140-1]
printer1=\\ash2\Rm 129C Science Office

[AS129C-*]
printer1=\\ash2\Rm 129C Science Office

[AS150-1 through AS165-1]
printer1=\\ash2\Rm 158 Classroom

[AS159-*]
printer1=\\ash2\Rm 159 DE3000

[AS201-1 through AS213-1]
printer1=\\ash2\Rm 209 Math Office

[AS219-1 through AS230-1]
printer1=\\ash2\Rm 220B English Office

[AS235-1 through AS239-1]
printer1=\\ash2\Rm 235 Special Ed Office

[AS243-1 through AS256-1]
printer1=\\ash2\Rm 256 World Lang Office

[ASA112-*]
printer1=\\asd11\AS Lower Guid DE5300

[ASA115-*]
printer1=\\asd11\AS Lower Guid Dell 2330dn

[ASL4-*]
building_printers=false
printer1=\\ash2\Rm L4 DE5300 (Mono)
printer2=\\ASH2\Library#1 DE5310 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASLIB-1 through ASLIB-25]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ASH2\Library#2 DE5310 (Mono)
printer3=\\ASH2\Library DE5100 (Color)

[ASLIB-26 through ASLIB-49]
building_printers=false
printer1=\\ASH2\Library#2 DE5310 (Mono)
printer2=\\ash2\Library#1 DE5310 (Mono)
printer3=\\ASH2\Library DE5100 (Color)

[ASM100-1 through ASM106-1]
printer1=\\ash2\Rm M106 Music

[ASP212-1 through ASP217-1]
printer1=\\ash2\Rm P215 Health

[ASP215-*]
printer1=\\ash2\Rm P215 Health

[ASS3-1 through ASS10-1]
printer1=\\ash2\Rm S10 Classroom

[ASS101-1 through ASS113-1]
printer1=\\ash2\Rm S101A Classroom

[ASS101A-*]
printer1=\\ash2\Rm S101A Classroom


;SPECIFIC MACHINES
;=================

[AS120-1]
printer1=\\AS119-1\Dell Open Print Driver (PCL XL)

[AS121-1]
printer1=\\ash2\Rm 121 HP4600 (Color)

[AS209-2]
printer1=\\ash2\Rm 209 Math Office

[AS220B-1]
printer1=\\ash2\Rm 220B English Office

[AS222C-1]
printer1=\\ash2\Rm 222#2 DE5300 (Mono)

[AS233A-1]
printer1=\\ASH2\Rm 235 Special Ed Office

[AS233B-1]
printer1=\\ASH2\Rm 235 Special Ed Office

[ASA103-1]
printer1=\\asd11\AS Upper Guid DE5300

[ASA118-1]
printer1=\\ash2\Rm M106 Music

[ASLIB-CIRC1]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ash2\Rm L4 DE5300 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASLIB-CIRC2]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ash2\Rm L4 DE5300 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASLIB-CIRC3]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ash2\Rm L4 DE5300 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASLIB-OFFICE1]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ash2\Rm L4 DE5300 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASLIB-OFFICE2]
building_printers=false
printer1=\\ash2\Library#1 DE5310 (Mono)
printer2=\\ash2\Rm L4 DE5300 (Mono)
printer3=\\ASH2\Library#2 DE5310 (Mono)
printer4=\\ASH2\Library DE5100 (Color)

[ASRECORDS-1]
printer1=\\asd11\AS Records Hp 4200

[ASRECORDS-2]
printer1=\\asd11\AS Upper Guid DE5300

[ASS4A-1]
printer1=\\ash2\Rm S10 Classroom

[ASS4B-1]
printer1=\\ash2\Rm S10 Classroom

[ASS10C-1]
printer1=\\ash2\Rm S10 Classroom

[ASS10-C]
printer1=\\ash2\Rm S10 Classroom

[ASS101A-1]
building_printers=true

[ASSEC-1]
printer1=\\asd11\Sr Prin Dell 2330dn

[AS107-1]
building_printers=false
printer2=\\ASH2\Ricoh Copier Mail Rm

[ASA109-1]
building_printers=true