Use /GET_LUN on the file open statements, and /FREE on the window commands IDL> openr, lun, filename, /get_lun ;GOOD EXAMPLEIDL> openr, 1, filename ;BAD EXAMPLE