Witto is right, i cant help you with the batch neither. I did translate the important parts of the batch to kix for you. I tested it, it works. If you tell us exactly how you tested the kix-code when it failed, we can help you find the problem.
As a hint: dont try the code on a local workstation with mapped network printers! If you do that, it tries to change the printername on the printserver or the client which shared the printer. It only works correctly with *local* printers on a client (for testing purposes) or with printers *in* a citrix session.

Apart from that, i think it might be helpful for you to read a bit around the whole citrix printing process.