help onedrive

Title

onedrive -- Command to find and set Microsoft OneDrive local folder as Stata's working directory

Syntax

onedrive
[, nocd]

Description

onedrive locates a user's Microsoft OneDrive directory and sets Stata's working directory to that location. The command is useful for running do-files saved in OneDrive across different computers (e.g., office or home) or shared between colleagues without the need to manually amend the working directory in the do-file. onedrive works only if a single OneDrive account is installed (either a personal, work, or school account) and no other folders containing the word 'onedrive' are in the same directory.

Option

nocd does not change the directory to OneDrive but save the results in r(db).

Stored results

The OneDrive directory is stored in r(db) and can be viewed with return list.

Acknowledgment

This program is based on a modification of the command dropbox. All credits to their authors, Raymond Hicks and Dustin Tingley. dropbox was featured in Stata Journal, volume 14, number 3: pr0058.

Author

Giacomo Zanello

University of Reading

Reading, UK

If you use the command, please consider citing this software as follows:

Giacomo Zanello, 2024. "ONEDRIVE: Command to find and set Microsoft OneDrive local folder as Stata's working directory" Statistical Software Components S459284, Boston College Department of Economics.

Last updated

1 February 2024