Thanks for providing additional info. I'm not entirely sure why you're seeing this error. There are some pieces of information which are unknown to me like the version of MATLAB you're using and the directory structure that you're working with. Here are a few suggestions:
1. In R2019b and earlier, the error message "The system cannot find the path specified" occured when the destination directory did not exist. So, that's one thing you could check.
2. You said your script works when you run it from within a subfolder that contains the files that you are trying to copy. You can check whether your Archivos_168h.txt file includes subfolder information. Refer to listOfFiles.txt in the example below.
3. Since I'm not too sure of your setup, I can share what works for me. You can adapt this to see if it works for you too. I'm using R2021a.
This is a screenshot of my C:\Users\Asvin\TestCopyFile directory
file1-file6 are dummy files for testing. I want to move all 6 files to a folder called 'movehere' in the same directory.
This is what scriptToCopyFiles.m looks like (very similar to yours):
Here's what listOfFiles.txt looks like:
Note that I mention the path to file3-file6 relative to my current directory which is TestCopyFile.
And running the script with this setup works for me. Here's what the directory looks like after running the script:
If none of these suggestions work for you, I would recommend two approaches:
- Contact tech support via phone/email so that they can address your concerns quicker. Those channels are recommended for back-and-forth communication. Refer the contact us page. [Recommended]
- You could get back to me with details of your matlab version and preferably attach a zip file with a few test files that will help me reproduce this error that you're seeing.