.. highlightlang:: us .. index:: GetUserDirectory .. _getuserdirectory: GetUserDirectory ================ .. us.tag GetUserDirectory NOTREADYENGLISH FILE_MISC New340 Changed400 Changed510 Changed5503 :ref:`GetUserDirectory` returns the UniPlot user directory. .. function:: ssUserDir = GetUserDirectory() ssUserDir = GetUserDirectory(bLocal) .. us.return **Return Value** *ssUserDir* is the name of the UniPlot User Directory. .. us.params **Parameters** .. uparam:: bLocal *bLocal* is an optional parameter. If the UniPlot user directory is not on a local drive ``GetUserDirectory(TRUE)`` returns a local directory specified in the environment variable ``LocalAppData``. For example :file:`c:\\users\\peter\\AppData\\Local\\UniPlot\\`. .. us.example **Example** .. highlight:: none **Example** :: * GetUserDirectory() C:\Documents and Settings\Peter\My Documents\UniPlot .. us.comment **Comment** The user home directory is set in the registry. UniPlot will use the directory for application data (key "Personal"). In this directory UniPlot will create a directory with the name :file:`uniplot`. Example: :file:`c:\\documents and settings\\samuel brüggenkoch\\my documents\\uniplot\\`. If a user name is specified in the command line (see Properties in the UniPlot icon on the desktop), e.g. :: uniplot.exe /user "TDA" the user name "TDA" will be added to the path. The user home directory would then look like this: Example: :file:`c:\\documents and settings\\samuel brüggenkoch\\my documents\\uniplot\\TDA\\`. If you do not want to use the default user home directory, you can set the directory in the registry found in the key ``Settings\User-Home-Directory``. The following function call will set a home directory and can be executed in the UniPlot :ref:`viewcommand-window`: :: WriteProfileString("Settings", "User-Home-Directory", "c:\\MyUniPlotHomeDir") Please use Explorer to create the directory if the dircectory does not yet exist. The user home directory is displayed in the :ref:`toolsmore-options` dialog box. In the user home directory, the following folders should be created: .. list-table:: :header-rows: 1 * - Directory - Meaning * - Addin - Directory for user Addins. * - Autoload - UniPlot will load all UniScript files with the extension :file:`.ic` during startup from this directory. * - Script - UniScript files should be saved in this directory. * - Template - This directory is for templates, style file, etc. * - Settings - Directory for files with settings, log files, etc. * - data - Default directory for NC files. .. us.history **History** .. highlight:: us **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.3 - New Parameter *bLocal*. * - 5.1.0 - Subdirectiories will be created, if they do not already exist, when the function is called. A new sub directory "Settings" has been added. .. seealso:: :ref:`overview-files`, :ref:`toolsmore-options`, :ref:`GetRootDirectory`, :ref:`GetWindowsDirectory` :sub:`id-1781776`