Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used the FileOpenDlg() function to allow the user to choose a file. I would like to do the same thing to allow them to choose a folder so I can save files to the folder without the user having to interact every time a file saves. Is there a function for this?

share|improve this question
up vote 2 down vote accepted

There is no MapBasic command to get a directory path. You can extract the directory from a full file path string and truncating at the last \ etc, but it's messy and not a nice solution.

A much better way is to use a Shell API or .NET function, some examples of which can be found here:!msg/mapinfo-l/MGFhmQSpmwo/7irVqnPhZosJ

share|improve this answer
Just what I needed. Thanks. – user15642 Jun 13 '13 at 14:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.