How to determine the Dropbox folder location programmatically?

前端 未结 8 1155
故里飘歌
故里飘歌 2020-12-06 09:38

I have a script that is intended to be run by multiple users on multiple computers, and they don\'t all have their Dropbox folders in their respective home directories. I\'d

8条回答
  •  [愿得一人]
    2020-12-06 10:27

    Note: answer is valid for Dropbox v2.8 and higher

    Windows

    jq -r ".personal.path" < %APPDATA%\Dropbox\info.json
    

    This needs jq - JSON parser utility to be installed. If you are happy user of Chocolatey package manager, just run choco install jq before.

    Linux

    jq -r ".personal.path" < ~/.dropbox/info.json 
    

    Just similarly to Windows install jq using package manager of your distro.

提交回复
热议问题