It's nice to see a variety of methods acheiving the same result. I use "if %WINDIR%!==R:\WTSRV!" in the calling batch file rather than perform the test with Kixtart. This has the advantage that that Kixtart is not called at all, thereby reducing the overhead and speeding the logon process slightly. As the Citrix server is more likely to have multiple simultaneous logons than any of our other servers this small saving could conceivably make a difference.