# How to change the start path of SystemDialogInput

It seems that every time the start directory of SystemDialogInput is always the same, is it possible to set the start directory to the last used directory?

For example:

SystemDialogInput["FileOpen"]


will start from the "Documents" directory, if I change to other directory and select some file, and run the second input dialog

SystemDialogInput["FileOpen"]


it forgets the directory I chose in the first SystemDialogInput and starts from "Documents" directory again. Is it possible to set SystemDialogInput to always remember the last used directory?

-
Use the second argument of SystemDialogInput, and store the path in some variable. –  Leonid Shifrin Jul 8 '13 at 22:55

## 1 Answer

You should simple do something like this:

file = SystemDialogInput["FileOpen"]

SystemDialogInput["FileOpen", DirectoryName@file]


and your directory is the last one you've visited.

-
it's interesting. at first i started to write a RegularExpression and failed and then suddenly this nice function reared up...probably to often reinventing the wheel. –  Stefan Jul 8 '13 at 23:16