Thanks for this. It would indeed be the solution if I could be sure that
the directory structure would stay the same. But I cannot overlook what
data I am going to have in 3 months from now. It might be that what is
in "D:\projectdir\dir1" is moved to "D:\projectdir\anotherdir\dir1", for
example. In such a case I don't want to change all instances of ../dir1/
in all my do-files.
OK, so you are not the one who decides on the directory structure? Then i
can only suggest you take Benoit's advice and work with local macro on top
of your do-files. Even then you can use relative paths, like: