Borrar filtros
Borrar filtros

How to access UNC path with credentials?

13 visualizaciones (últimos 30 días)
Binay Chandra
Binay Chandra el 10 de Nov. de 2017
Comentada: Colin el 17 de Mzo. de 2021
I am looking for the ways to access UNC paths which require credentials. I am currently using Matlab 2016b. Please help.

Respuesta aceptada

Guillaume
Guillaume el 10 de Nov. de 2017
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 comentarios
Jan
Jan el 10 de Nov. de 2017
While this is a good solution, remember, that storing passwords in clear text is a really bad idea.
Colin
Colin el 17 de Mzo. de 2021
Can you recover the clear text password if the script is compiled into an application?

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by