I also received the "Invalid MS-DOS Function" error while copying files, but under a different circumstance: Windows 7, copying files from an SMB share on an Mac OS X Lion machine.
(This won't apply to you, but this is the only Super User question referencing "Invalid MS-DOS Function", so I mention it only in hopes of helping someone else!)
On the Mac, I opened a Terminal and ran ls -al
in the affected directory, and noticed this:
drwxr-xr-x@ 4 Blair staff 136 18 Jan 21:52 Stuff
The @
mark is important -- it indicates that the file/folder has Extended Attributes.
This was the only folder I was having trouble copying; I checked all the other files and folders that copied successfully and discovered that they lacked extended attributes.
Running ls -al@
reveals what the extended attributes are:
drwxr-xr-x@ 4 Blair staff 136 18 Jan 21:52 Stuff
com.apple.quarantine 48
This is the quarantine attribute used by the OS to mark files downloaded from the internet as "potentially unsafe".
Believing the attribute to be playing foul with Windows, I decided to remove it. This answer shows how:
xattr -dr com.apple.quarantine Stuff
I returned to the Windows machine and started copying the folder again -- it worked without a problem.
Microsoft doesn't bother renaming ancient error messages? – Michal Kováč – 2014-07-30T19:09:17.450
@MichalKováč, I know right? Isn’t it something that even Window 10 still contains the string “MS-DOS”? Sheesh. I really can’t imagine why this message exists at all. The closest I can come to even attempting to explain it is that the file-io function uses interrupt 2F or something, but I highly doubt that is the case. – Synetech – 2017-04-16T16:58:56.327