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

4 次查看(过去 30 天)
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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2018-9-28
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 个评论
Deep
Deep 2018-10-1
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Software Development Tools 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by