I am using Stata 19 on a Windows computer.
When I launch Stata on my computer by double-clicking on a Stata-formatted file (.dta, .do, .gph, etc.), the working directory is always the folder in which the file I double-clicked on is stored.
When I launch Stata from the Windows program menu, the working directory is always my documents folder: C:\Users\rball\Documents
But when my students are working with Stata, there is some variation in what folder is initially designated as the working directory when Stata is launched.
When I ask a large group of students to launch Stata by double-clicking on a Stata-formatted file, for most of them the initial working directory is the folder in which the file is stored--which is what I expect. But there are always a few who report that the working directory is initially set to some folder other than the one in which the file is stored--sometimes their downloads folder, sometimes their documents folder, sometimes some other folder that seems completely arbitrary.
Similarly, when I ask students to launch Stata from the programs menu, it is often the case that, as I expect, the working directory is initially set to their documents folder. But again, there are always a few students for whom the initial working directory is something unexpected.
At one level, this does not pose a problem: I just tell students that when they launch Stata, they must (i) decide what folder they want to be designated as the working directory, (ii) execute the pwd command to see what folder is initially designated as the working directory, and (iii) if the working directory is not initially set to the folder they chose to be the working directory, then they must change the working directory to the folder they want (either with a cd command, or using the menu: File-->Change working directory... etc.).
But I would like to be able to explain to them why there is some variation in which folder is initially designated as the working directory when they launch Stata.
Is their any explanation for the variation I have described?
************************************************** ***********
The above is the general version of my question, but one additional detail might be important: Some of my students use Windows computers and some use Macs. Should we expect Stata's behavior with respect to setting the working directory upon launch to be different on a Mac than on a Windows computer?
When I launch Stata on my computer by double-clicking on a Stata-formatted file (.dta, .do, .gph, etc.), the working directory is always the folder in which the file I double-clicked on is stored.
When I launch Stata from the Windows program menu, the working directory is always my documents folder: C:\Users\rball\Documents
But when my students are working with Stata, there is some variation in what folder is initially designated as the working directory when Stata is launched.
When I ask a large group of students to launch Stata by double-clicking on a Stata-formatted file, for most of them the initial working directory is the folder in which the file is stored--which is what I expect. But there are always a few who report that the working directory is initially set to some folder other than the one in which the file is stored--sometimes their downloads folder, sometimes their documents folder, sometimes some other folder that seems completely arbitrary.
Similarly, when I ask students to launch Stata from the programs menu, it is often the case that, as I expect, the working directory is initially set to their documents folder. But again, there are always a few students for whom the initial working directory is something unexpected.
At one level, this does not pose a problem: I just tell students that when they launch Stata, they must (i) decide what folder they want to be designated as the working directory, (ii) execute the pwd command to see what folder is initially designated as the working directory, and (iii) if the working directory is not initially set to the folder they chose to be the working directory, then they must change the working directory to the folder they want (either with a cd command, or using the menu: File-->Change working directory... etc.).
But I would like to be able to explain to them why there is some variation in which folder is initially designated as the working directory when they launch Stata.
Is their any explanation for the variation I have described?
************************************************** ***********
The above is the general version of my question, but one additional detail might be important: Some of my students use Windows computers and some use Macs. Should we expect Stata's behavior with respect to setting the working directory upon launch to be different on a Mac than on a Windows computer?
Comment