ShaneEP

No they are not supposed to go to both.

So I added a line at the end of the Mercy section to skip to a different section. Is this correct.

 Code:
IF Left(@WKSTA, 5) = "55PUL"
	GOTO Pulaski
Else
	GOTO Mercy
ENDIF

:Mercy

; a VARTYPE of 8 means that the value of $printer is a string, try to map the printer
IF VARTYPE($printer) = 8
	IF AddPrinterConnection($printserver + $printer) = 0
		WRITELINE(5, "Mapped Default Printer to " + $printserver + $printer + @CRLF)
		; The SetDefaultPrinter command relies on the printer NAME not the printer SHARE
		$nul = SetDefaultPrinter($printserver + $printer)
	ELSE
		$nul = WRITELINE(5, "An error occurred mapping the Default Printer to " + $printserver + $printer +@CRLF)
	ENDIF
ENDIF

; Read the next 4 lines of the file and concatenate them. Check to see if they are empty.
FOR $count = 1 TO 4
	$nextline = READLINE(1)
	$printer = SUBSTR($nextline,12)
	IF VARTYPE($printer) = 8
		IF AddPrinterConnection($printserver + $printer) = 0
			$nul = WRITELINE(5,"Created a Printer Connection to " + $printserver + $printer + @CRLF)
		ELSE
			$nul = WRITELINE(5,"An error occurred creating a printer connection to " + $printserver + $printer + @CRLF)
		ENDIF
	ENDIF
GOTO Setup 

Thanks for your help!!!!


Edited by Mart (2011-08-30 04:45 PM)
Edit Reason: Please use code tags when posting code.