PreferencesFolder Function

Used to access the Preferences folder.

Syntax
result = PreferencesFolder( )

Return Value
Result | FolderItem | A FolderItem that represents the Preferences Folder or Application Data directory.

# Notes

Use the PreferencesFolder function to access the user's Preferences folder. If your application has user-defined preferences, it is a good idea to store the preference values in a file and place it in the Preferences folder. This allows the user to reinstall your application if necessary and retain their current preferences.

The PreferencesFolder function provides a way to access the Preferences folder that will work under different language systems, and will continue to work if the operating system is reorganized.

The SpecialFolder module enables you to access many other special folders that are managed by the OS.

## Windows

On Windows, PreferencesFolder returns a reference to the c:\Documents and Settings\username\Application Data directory, if available. On Windows 98 it accesses the Windows directory.

## Macintosh

On Mac OS X, PreferencesFolder returns a reference to the /Users/username/Library/Preferences folder. On Macintosh "classic", it returns a reference to the Preferences folder in the System folder.

## Linux

On Linux, PreferencesFolder returns a reference to the current user's Home directory, /Home/username.

# Example

This example displays the absolute path to the Preferences folder or Application Data directory, if it exists on the user's machine.

Dim f As FolderItem
f=PreferencesFolder
if f <> Nil Then
MsgBox f.AbsolutePath
Else
MsgBox "The folderItem does not exist."
End if

# See Also

ApplicationSupportFolder, DesktopFolder, FontsFolder, StartupItemsFolder, SystemFolder, TemporaryFolder, TrashFolder, SpecialFolder functions.