필터 지우기
필터 지우기

How to access UNC path with credentials?

조회 수: 12 (최근 30일)
Binay Chandra
Binay Chandra 2017년 11월 10일
댓글: Colin 2021년 3월 17일
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일
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개)

카테고리

Help CenterFile Exchange에서 Java Client Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by