The question on SO that you linked has a “2021 update” from me (path - How to change the Jupyter start-up folder - Stack Overflow), but I will quote it here for convenience:
For recent
nbclassicand JupyterLab>=3 usec.ServerApp.root_dirinstead ofc.NotebookApp.notebook_dir.For context see migration guide and this question on differences between
serverandnotebook.
So you would run jupyter server --generate-config and should be able to grep-find root_dir (even better, I think it will tell you where the config got generated into).