I am looking for the ways to access UNC paths which require credentials. I am currently using Matlab 2016b. Please help.

 채택된 답변

Guillaume
Guillaume 2017년 11월 10일

0 개 추천

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));

댓글 수: 2

Jan
Jan 2017년 11월 10일
While this is a good solution, remember, that storing passwords in clear text is a really bad idea.
Colin
Colin 2021년 3월 17일
Can you recover the clear text password if the script is compiled into an application?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2017년 11월 10일

댓글:

2021년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by