How to connect to onedrive

63 views (last 30 days)
Robert Winkel
Robert Winkel on 4 Oct 2016
Commented: Romuald GYORGY on 15 Sep 2023
when using different pc's my matlab has issues connecting to one drive, partly driven by the fact that the path name is different due to teh pc I am using.

Accepted Answer

Marc Jakobi
Marc Jakobi on 7 Oct 2016
It's hard to determine from your question what exactly you are trying to do. But this may help:
Using the line
hostname = char(getHostName(java.net.InetAddress.getLocalHost));
you can get the name of your PC. I have my startup.m in a onedrive folder. And by using this line I can set paths accordingly in my startup script and perform various different startup tasks depending on which PC I am using.
  1 Comment
Romuald GYORGY
Romuald GYORGY on 15 Sep 2023
It is also possible to get the location of the OneDrive folder by reading environment variables.
getenv('OneDrive')
getenv('OneDriveCommercial')
The first line is usually what you need.

Sign in to comment.

More Answers (1)

Leo Lee
Leo Lee on 24 Oct 2017
Move your Onedrive folder to C: root folder (for both computers). That will solve the problem.

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!