1 year ago
#382453
Matze
Robocopy Error 64 (0x00000040) when copy specific file extensions to SharePoint
i am using a Windows 10 64bit laptop to copy a bunch of folder and files to a SharePoint folder. My Script is running in PowerShell.
If i try to copy the files and folders with the explorer (strg+c and strg+v) everything except .exe files are copying. .exe files are blocked from the server.
If Robocopy is trying to copy the same set of folders and files:
First i use: Get-Credential
then: Connect-PnPOnline
and then copying with Robocopy.
If i copy the complete bunch of the folder i use following code:
ROBOCOPY $orgPath $newPath /MIR /dcopy:DAT /copy:DAT /r:0 /w:1
Robocopy is then working with this options:
*.* /S /E /DCOPY:DAT /COPY:DAT /PURGE /MIR /R:0 /W:1
If i just copy single files i use:
ROBOCOPY $orgPath $newPath $fileName /dcopy:DAT /copy:DAT /r:0 /w:1
Robocopy is then working with this options:
/DCOPY:DAT /COPY:DAT /R:0 /W:1
$orgPath = the path of the folder i want to copy (local or network drive)
$newPath = the path of the folder where i want to copy to (SharePoint)
$fileName = the file i want to copy
I just copy if the folder/file is not existing already.
With both versions i get the same result.
This is working fine. Robocopy is copying. The folders and the most files (.xmlx .txt) are copying The .exe files get the error 222 because the server is blocking this file. That is normal and i understand why he is doing it.
BUT: .pdf files do not copy with robocopy. This files gives the error 64 (0x00000040). So the server is not blocking this file. (i also can copy this file using the explorer) but all the .pdf files getting this error using robocopy. But of course the connection is still working. robocopy is still copying further the .xmlx and .txt files. The error is relating to the extension. But i do not know why and i do not know how to solve the problem. The Name of the .pdf files do not have any special caracters.
Does anyone can help me to fix the problem?
Thanks in advance
With best regards
Matze
powershell
sharepoint
robocopy
0 Answers
Your Answer