I'm writing on a batch file to copy a certain file to a samba-share.
I've already read robocopy transfer file and not folder and thought I would be good using
robocopy "E:\Some\Path\with spaces" "\\sambaServer\some\path\with spaces" "myFile.rar" /z /MIR
But I keep seeing
Source: E:\Some\Path\with spaces\
Destination: \\sambaServer\Some\path\with spaces" myFile.rar \Z \MIR\
Files: *.*
And ofcourse I get an error
ERROR 123 (0x0000007B) Accessing Destination folder \\sambaServer\Some\path\with spaces" myFile.rar \Z \MIR\ The syntax for file name, folder name or the volume label is incorrect.
So apparently robocopy
takes the whole second part - the destination folder, the file and the parameters - together as the destination folder.
Why is this not working? What am I doing wrong?
It worked when I copy the whole folder instead using
robocopy "E:\Some\Path\with spaces" "\\sambaServer\some\path\with spaces" /z /MIR