How to connect to onedrive

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

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

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

Tags

Community Treasure Hunt

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

Start Hunting!