Connect to a Citrix Server from the Command Line

Use this command-line script to connect to a Citrix server.

Alex Angelopoulos

October 20, 2002

1 Min Read
ITPro Today logo


A frustration for consultants who work on different servers every day is that almost all GUI connection tools, including the standard Citrix client, require housekeeping before you can connect to a server. To work around this problem, you can create a connection file that contains all the relevant data. My solution is to use a batch file that takes the target Citrix server's address as an argument, as well as the connection's desired resolution. The batch file, which Listing 1 shows, then generates an ICA file (i.e., a plain text file with information about the connection) and launches the ICA client to connect to the Citrix server.

Running this batch file leaves two files on your system: ica.log and tmp.ica, both in your global %TEMP% folder. If you have the Sleep command on your system, you can uncomment the lines rem sleep 2 and rem del %icafile% to automatically delete the temporary ICA file.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like