Jonas,

Welcome to the board!

Are you doing a migration from one print server to another? If so, you may want to have a look at -

Prevent special printers from being deleted

And references this UDF():
PriMapState() - Checks for existent printerconnection

If you are simply trying to delete the printers, maybe try adding a SLEEP after Delprinterconnection ..

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's