Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Possible to change the working directory automatically (for instances when work is done on different computers)?


From   Anna Reimondos <areimondos@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Possible to change the working directory automatically (for instances when work is done on different computers)?
Date   Thu, 18 Jun 2009 13:24:58 +1000

Hello,
I work from my office, but nearly everyday I take things home to do as
well using an external hard drive. The setup of the folders on the
external harddrive is exactly the same as on my work computer, but
obviously the full pathname is different.

Whenever I use STATA I usually open of the program, then open the
do-file I am working on. At the top of the do file, the first thing
that is written is a change directory command "cd *******\Project_1"
, and then there are commands to read in the data and so on.

At the moment I have two cd commands written on each do-file one under
each other. One refers to the work pathname, and one refers to the
home one.
 If I am at work I run only the work cd command, and if I am at home
the work one. This works reasonably well but it is annoying that I
can't ever run the whole do file because I first have to check that
the correct cd command is written. Also sometimes the external
harddrive goes in different usb slots, which messes up the pathname
system.

My question is: Is there any way to set the working directory to the
one where the do-file came from, without explicitly stating the
pathname ?
Does anyone else have a good system that works from them if they
frequently work on different computers?

Cheers
Anna
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index