MATLAB: How to copy a set of files from an a drive with Read-only access to a local drive

access deniedcommandcopycopyfilefoldermovefileread writeread-only

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

Best Answer

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')
Related Question