IDL Startup Directory

QUESTION: I'm working with IDL 7 on a Windows XP computer. I notice that whenever I run DIALOG_PICKFILE and don't explicitly choose a starting directory the initial directory is always off somewhere in the Documents and Settings directory. I'm old school, and my IDL files are a long way from the Documents and Settings folder. How can I make this dialog start somewhere closer to home?

ANSWER: In IDL 7, the starting directory is chosen by setting the IDL_START_DIR preference. In previous versions of IDL, this was the IDL_WDE_START_DIR preference and was often set by choosing the name of the Working Directory in the File -> Preferences -> Startup dialog. In IDL 7, this is set from the Window -> Preferences -> IDL -> Initial Working Directory preference.

To see all your current IDL preferences, and how they are set, use the PREFERENCES keyword to the HELP command, like this:

   IDL> Help, /PREFERENCES

By default in IDL 7, the IDL_START_DIR preference is set to a null string. If so, then your starting directory is set to your “home” folder. In Windows, this is always off in the Documents and Settings folder somewhere.

If you would prefer it to be set to someplace sensible, then you will have to set it yourself. Suppose, for example, I wanted to set it to G:\IDL Workspace\Incubator. I could do so like this:

   IDL> Pref_Set, 'IDL_START_DIR', 'G:\IDL Workspace\Incubator', /COMMIT

Or, you can simply set the Initial Working Directory preference in the IDL preferences. (Available from the Window -> Preferences menu item.)

I have had, on one of my machines, setting these preferences not work in the IDL Workbench. If that happens to you, close all the open Editor windows in your Workbench and exit IDL. Then re-start the Workbench. That solved the problem for me.

Google
 
Web Coyote's Guide to IDL Programming