How can I get a non-UNC path with the tempfile function?

If I call the tempfile function on a Window PC I get an UNC path (starts with \\). I think this is because I am running a network version of MatLab. What do I have to do to get a regular DOS path (e.g. E:\)? Can I just map the LAN drive that I get?

 Accepted Answer

You may need to map the directory to a drive as well as set your $TEMP environment variable accordingly (you will need to restart MATLAB to get updated environment variables).

1 Comment

Thanks. We'll give this a try. Client also said setting current directory to C:\ did the trick.

Sign in to comment.

More Answers (1)

I am thinking this may be the answer from the workaround section.
On a Windows® platform, you should not start a MATLAB session, from a Universal Naming Convention (UNC) path, such as \\mycompany\bigserver\matlab. You will see errors if you do this. UNC paths are not supported for matlabroot.
You can work around this by mapping a drive to the location.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!