### set-current-directory

#### set-current-directory string

Sets the current directory that is used by the primitives file-delete, file-exists?, and file-open.

The current directory is not used if the above commands are given an absolute file path. This is defaulted to the user's home directory for new models, and is changed to the model's directory when a model is opened.

Note that in Windows file paths the backslash needs to be escaped within a string by using another backslash "C:\\"

The change is temporary and is not saved with the model.

Note: in applets, this command has no effect, since applets are only allowed to read files from the same directory on the server where the model is stored.

    set-current-directory "C:\\NetLogo"
    ;; Assume it is a Windows Machine
    file-open "my-file.txt"
    ;; Opens file "C:\\NetLogo\\my-file.txt"

Take me to the full NetLogo Dictionary