This is an archived page. It's not actively maintained.



Returns an object representing one of the standard directories.

Method of

Install object


FileSpecObject getFolder (
   String FolderName);

FileSpecObject getFolder (
   String folderName,
   String subDirectory);

FileSpecObject getFolder (
   Object localDirSpec,
   String subDirectory);


The getFolder method has the following parameters:

A string representing one of Netscape's standard directories. There are two sets of possible values for this parameter. The first set contains platform-independent locations; the second set contains platform-specific locations. You are encouraged to use the platform-independent locations. See the list in the Description section for the two sets of locations.
A string that specifies the name of a subdirectory. If the specified subdirectory doesn't exist, it is created. This parameter is available in Netscape 6 or later and may be case sensitive (depending on the operating system).
A FileSpecObject representing a directory obtained by getComponentFolder or getFolder.


A FileSpecObject representing one of Netscape's standard directories, or NULL in case of error or if subDirectory refers to a file that already exists.


The getFolder method obtains an object representing one of Netscape's standard directories, for use with the addFile and getWinProfile methods. The value of folderName must be one of the following (info is based on Mozilla 1.7 stable branch, might also work in other versions):

"Current User"
"OS Drive"

"Mac Apple Menu"
"Mac Control Panel"
"Mac Desktop"
"Mac Documents"
"Mac Extension"
"Mac Fonts"
"Mac Shutdown"
"Mac Startup"
"Mac System"
"Mac Trash"
"Mac Preferences"

"MacOSX Default Download"
"MacOSX Home"
"MacOSX Internet Sites"
"MacOSX Local Applications"
"MacOSX Local Desktop"
"MacOSX Local Documents"
"MacOSX Local Frameworks"
"MacOSX Local Internet PlugIn"
"MacOSX Local Preferences"
"MacOSX Movie Documents"
"MacOSX Music Documents"
"MacOSX Picture Documents"
"MacOSX User Applications"
"MacOSX User Desktop"
"MacOSX User Documents"
"MacOSX User Frameworks"
"MacOSX User Internet PlugIn"
"MacOSX User Preferences"

"Unix Lib"
"Unix Local"

"Win AppData"
"Win Common Files"
"Win Desktop"
"Win Desktop Common"
"Win Program Files"
"Win Programs"
"Win Programs Common"
"Win StartMenu"
"Win StartMenu Common"
"Win Startup"
"Win Startup Common"
"Win System"

The "file:///" form is only valid when the subDirectory parameter is used. It must be in file: URL format minus the "file:///" part. For example,

mydir = getFolder("file:///", "c|/mysoftco/somedir");

Note that forward slashes are used, regardless of the platform.

The folders whose names start with "Win", "Mac", or "Unix" are specific to those platforms. You should be careful about using one of those directories, as it makes your installation platform-specific.


To get an object representing the standard plug-ins directory, you would use this call:

plugindir = getFolder("Plugins");