Alternative default folder path


Concerning The -paths option shows where syncthing will create the default folder. Is it possible with the initial start of syncthing to create the default folder at an alternative path?

Thank you.

You can use a script to start syncthing and inside that script set HomeDrive and HomePath as you like. This will then “override” what syncthing sees as ~.

You can also set the environment variable “STNODEFAULTFOLDER” to prevent the creation of a default folder at all.

Just to remark, I see that home (as filepath.Join(os.Getenv(“HomeDrive”), os.Getenv(“HomePath”))) should in my case be X:, but calling syncthing with -paths gives X:\\Sync as default sync folder directory. I wonder where the extra \ comes from.

One solution due to the choice of home in syncthing for Windows is to overwrite HomeDrive to be empty and HomePath with UserProfile. This works, and the default folder is then at %UserProfile%\Sync.

I also tried with STNODEFAULTFOLDER set in the batch file and it works, i.e. doesn’t create the default folder.

Thanks for your help.

This is now a solution for an initial setup of syncthing with the default folder locally on a device. Due to the code snippet

if path == “~” { return getHomeDir() }

is there the possibility to set the ~ variable in syncthing to any other value, to prevent a new folder ~\wherever to be created at X:\wherever?

Thank you.

No, as ~ on all operating systems implies the home directory, which you seem to be overwriting and setting to X:\

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.