Here is one way...

 Code:
? "Adding Printers"
if not primapstate("\\server1\draft")
  $rc=addprinterconnection("\\server1\draft")
endif
if not primapstate("\\server1\bond")
  $rc=addprinterconnection("\\server1\bond")
endif

? "Removing Old Printers"
if primapstate("\\server1\letters")
  $RC=delprinterconnection("\\server1\letters")
endif
if primapstate("\\server1\documents")
  $RC=delprinterconnection("\\server1\documents")
endif
if primapstate("\\server\hpletters")
  $RC=delprinterconnection("\\server\hpletters")
endif
if primapstate("\\server\hpdocuments")
  $RC=delprinterconnection("\\server\hpdocuments")
endif
if primapstate("\\server\lmdocuments")
  $RC=delprinterconnection("\\server\lmdocuments")
endif


PriMapState() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=83306#Post83306

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1