I want to run batch file which copy all relevant folders and sub-folders from a remote computer to my client computer. I am using the following XCOPY command:
xcopy "\\Server_Name\C$\folder_X\folder_Y" "C:\Users\\folder_Z" /I /S /Y /D:%mydate%
and got "invalid drive specification" upon running the batch file.
(maybe it related: when trying connect manually via windows "run", typing \\Server_Name\C$\
,I got prompt to enter user and password and after that I can enter the relevant folders).
Thanks
Since Windows Server 2019 and Windows 10, a compression option is available in xcopy when copying across a network. With this switch, if the destination computer supports SMB compression and the files being copied are very compressible, there may be significant improvements to performance.
Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory. You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.
XCOPY is similar to the COPY command except that it has additional switches to specify both the source and destination in detail. /D:mm-dd-yyyy Copy files changed on or after the specified date. If no date is given, copy only files whose source date/time is newer than the destination time.
Try mounting your remote drive locally first:
net use x: \\Server_Name\C$
Then try copying the files from X:
instead:
xcopy x:\folder_X\folder_Y c:\Users\folder_Z ...
To unmount:
net use x: /delete
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With