The sysdir and adopath command

sysdir - Lists Stata's system directories

Stata expects to find various parts of itself in various directories (folders). However, rather than describing these directories as C:\Program Files\Stata16\ado\base or /usr/local/stata/ado, these places are referred to by codewords. By using sysdir command, we are able to list these different directories, and obtain the correspondence between codeword and actual directory:

STATA refers to the directory where the Staat executable is to be found.

BASE is where the original ado-files that were shipped with Stata and any updated official ado-files that have been made available since being installed.

SITE is relevant only on network computers. It is where administrators may place ado-files for sitewide use on networked computers.

PLUS is relevant on all systems. It is where ado-files written by other people that you obtain using the net command. By default, net installs files to this directory.

PERSONAL is where you are to copy ado-files that you write and that you wish to use regardless of your current directory when using Stata.

OLDPLACE is included for backward compatibility.

NOTE: Do not change the definition of BASE, you may change the definitions of SITE, PERSONAL, PLUS, or OLDPLACE.

If you want to reset a system directory permanently, please use the sysdir set command in your

adopath - displays the ado-file path stored in the global macro $S_ADO

adopath displays and resets the contents of the global macro $S_ADO, the path over which Stata searches for ado-files. The default search path is:

adopath mentions the actual directories, but if you changed the meaning of a codeword by using sysdir, that change would affect adopath. When Stata looks for an ado-file, it first look sin BASE. If the ado-file is found, then that copy is used. If it is not found, then Stata looks in SITE next, and if it is found there, then that copy is used. And so the process continues. At the forth step, Stata looks in the current directory, where there is no codeword.

adopath can also change the contents of the path. In general, you should not do this unless you are sure of what you are doing because many features of Stata will stop working if you change the path incorrectly. The path may include actual directory names, such as C:\kuaikuaiprogram, or codewords, such as PERSONAL, PLUS and OLDPLACE. To add C:\kuaikuaiprogram to the end of the path, type:

If later you want to remove this directory, just type:


© 2020 by Survey Design and Analysis Services. 

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube