*! version 1.0.0 17June2026 Wu Lianghai (agd2010@yeah.net)

help for editprofile

Syntax

editprofile (open existing profile.do)

editprofile, create [path(filename)]

editprofile, open [path(filename)]

editprofile, showpath [path(filename)]

Description

editprofile locates, opens, and optionally creates the
user-specific profile.do file. Stata executes
profile.do automatically whenever it is launched, allowing
users to set custom defaults (working directory, graphics scheme,
memory allocation, extra ado directories, etc.).

Called without any options, editprofile opens the first
profile.do found in Stata's standard search order — the
current working directory, the Stata installation directory, or
the PERSONAL ado directory. If no profile.do exists yet,
an error message is shown and the user is advised to use the
create option.

Options

create creates a new profile.do from a template if
one does not already exist at the target location. The template
includes commented settings for common customisations (working
directory, graphics scheme, memory, labels, matrices, scrollback,
ado paths, packages, and log type). If a profile.do
already exists, the existing file is opened in the do-file editor
instead of being overwritten.

open explicitly opens an existing profile.do in the
do-file editor. This is the default action when no option is
specified. The option is mainly provided for explicitness in
do-files and scripts.

showpath displays the full path of the profile.do
that editprofile would act on, without opening or modifying
the file. Useful for confirming which profile.do Stata is
using before making changes.

path(filename) specifies a custom location for
profile.do. The argument may be a full file path (ending
in profile.do) or a directory; if a directory is given,
profile.do is appended to it automatically. By default,
editprofile searches Stata's standard locations.

Search order

When path() is not supplied, editprofile searches
the following locations in order:

1. Current working directory (profile.do)

2. Stata executable directory
(c(sysdir_stata))

3. PERSONAL ado directory
(c(sysdir_personal))

The first location at which a profile.do is found is used.
If no existing profile.do is found anywhere, the PERSONAL
directory is proposed as the default location for creating a new
one. Placing profile.do in the PERSONAL directory is the
recommended practice — it keeps user customisations separate
from the Stata installation and travels with the user's ado
files.

Remarks

profile.do is a plain-text do-file that Stata looks for and
executes automatically on startup. It is distinct from
sysprofile.do, which is a system-wide startup file that
affects all users sharing a Stata installation. editprofile
only manages the user-specific profile.do.

Changes made to profile.do take effect the next time Stata
is launched. To apply changes immediately without restarting,
you can run the file manually:

do profile.do

Examples

1. Open your profile.do (the default).

. editprofile

2. Find out where your profile.do is (or would be).

. editprofile, showpath

3. Create a fresh profile.do from the template.

. editprofile, create

4. Create profile.do in a custom location.

. editprofile, create path("C:/myproject/")

5. Open an existing profile.do at a known location.

. editprofile, path("D:/ado/personal/profile.do")

Author

Wu Lianghai (吴良海)

School of Business

Anhui University of Technology (AHUT)

Ma'anshan, China

Email: agd2010@yeah.net

Version history

1.0.0 17June2026. Initial release.

end of help for editprofile