How to access UNC path with credentials?
12 次查看(过去 30 天)
显示 更早的评论
I am looking for the ways to access UNC paths which require credentials. I am currently using Matlab 2016b. Please help.
0 个评论
采纳的回答
Guillaume
2017-11-10
There's no direct way to access them in matlab. You probably could go through Java, or if on Windows, through .Net, but probably the simplest would be to mount the UNC through the OS. if on windows:
drivename = 'U:'; %whichever you want
unc = '\\somewhere\somepath\
user = 'username';
password = 'password';
system(sprintf('net use %s "%s" /user:%s %s', drivename, unc, user, password));
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Java Client Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!