How can I copy a set of files from an a drive with Read-only access to a local drive?

4 views (last 30 days)
I tried to use copyfile and movefile commands to test if I could copy 1 file from the folder in a drive that I have a read-only access to a local drive. However it gave me an error "Access is denied." It is not possible to obtain a read-write permission. I can manually copy the file, however it is not a good option since I have 100s of such files in other subfolders which I need to move as well. I would appreciate any suggestions on how to proceed with this problem

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 28 Sep 2018
Double check again. You should have no problem copying files from a read-only source location. The file might also be read-only once it is copied to the destination. I got "Access is Denied" message when running the copyfile() the second time (because the read-only file at the destination can't be over-written), but I can run copyfile(SrcFile,DstFile,'f')
  1 Comment
Deep
Deep on 1 Oct 2018
Thank you very much. It worked. The mistake that I was making was trying to copy the file to the "read-only" drive instead of setting the destination as local drive.

Sign in to comment.

More Answers (0)

Categories

Find more on Software Development Tools 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!