The more i think of it the more i'm sure the logonscript is not the best place for the code. If you have checked the citrix-option "dont wait for printer", which is best practice, citrix is usally still in the process of printer mapping when the logonscript runs. So the code would fail.
I would only uncheck that option if the users are not able to freely map printers to their local pc. If they do, theres always a good chance they have old, deceased printers or printers attached to another pc mapped, which may be offline. If so, the application start can take minutes before the printer mapping is finished, because citrix tries to map every dead printer x-times before skip to the next. The users usally dont accept that kind of delay. Mhm, ok, they might, if thats their only chance to print at all.

Anyway, afaik there are just a few apps that have problems with the long printernames, so i would place the script -as described before- in the application publishing. There is a chance citrix is still not finished with the mapping when the script starts, but its the latest possibility to start a script in a session. And, if you do it that way, its also not neccessary to check if its a TS-session.

Btw.: citrix solved that problem with long printernames with Presentation Server 4, finally.

@witto

Quote:

But if you have a Citrix server, is it wrong to verify if %clientname% exists?




No, its not. It usually works fine.

EDIT:
@ Nazeedah: if you really cant get the code to work, i just stumbled over this: a (free) Utility to Rename an Auto-Created Client Printer’s Name


Edited by therob (2006-09-22 01:18 AM)