I want to remove the 21 network printers from my profile using the following script.

break on
$Index = 0
do
$KeyName = ENUMKEY("HKEY_CURRENT_USER\Printers\Connections", $Index)
$x=left("$KeyName",13)
if $x=",,DRPDRD-KA01"
Delprinterconnection ($KeyName)
endif
$Index = $Index + 1
? $Index
? $x
? $KeyName

until @error <> 0

the ? are for me to see what is happening.
DRPDRD-KA01 is name of printserver

The problem is that after running the script only half of the printers are removed. after running script again another 5 are removed. After 4 times in a row running the script all printers are removed
why?
what did i do wrong?
I want it to happen running the script just once