Old thread but we've recently moved from Citrix XenApp v5 (running on Windows 2003) to XenApp v6.5 (running on Windows 2008 R2 x64). We have *exactly* the same problem. The SetDefaultPrinter returns a result of 0 but the default printer doesn't actually change.

Script reduced to a single line:

"Result=" SetDefaultPrinter("Mac02 - Olivetti MF350")

Returns "Result=0". Change the printer name to something invalid and you get "Result=2" so one has the printer name right.

I wonder if SetDefaultPrinter is changing the registry and isn't changing the right key re: syswow64 etc?

Cheers, Rob.