Code:
if addprinterconnection("\\server\share")<>0
  ;create a message on the screen with messagebox and @serror
  ;or create a log in shared directory with @serror
  ;or retry the connection attempt
endif