I don't have time today to figure out a way to loop the script...But I did check the IF/ELSE/ENDIFS real quick. They do seem to line up ok. Adding a little more consistent indentation might make it easier to tell.

 Code:
;================================================================================================
;  Checks if printer is installed, and installs the correct printer based on area
;================================================================================================

Function PrintInstall($PrintFile) ;This part installs the printer
   $handle = Freefilehandle()
   IF $handle > 0
      IF Open($handle, $ServerName + "\setup printers\" + $Printfile) = 0
         ? $Servername
         $printsetup = Readline($handle)
         WHILE @ERROR = 0
            $ReturnCode = KeyExist("Hkey_Current_User\printers\Connections\,," + $PrintServer + "," + $printsetup)
            IF $ReturnCode = 1
               ? $printsetup + " Printer is already installed"
            ELSE
               ? "We need to install this printer " + $printsetup
               AddPrinterConnection($ServerName + "\" + $printsetup) ;I presume that I need to put the loop after this line and to loop back to  IF $ReturnCode = 1
            ENDIF
            $printsetup = ReadLine($handle) ;This part checks if kixtart can open the file and read the contents
         LOOP
         IF Close($handle)
            Beep
            ? "Error closing file!"
         ENDIF
      ELSE
         ? "Unable to open" + $ServerName + "\setup printers\" + $PrintFile
      ENDIF
   ELSE
     ? "Unable to obtain a free system handle."
   ENDIF
EndFunction


Edited by ShaneEP (2019-06-13 01:48 PM)