I have a storage folder on a network in which all users will store their active data on a server. Now that server is going to be replaced by a new one due to place problem s
To bypass the 'specify a file name or directory name on the target (F = file, D = directory)?' prompt with xcopy, you can do the following...
echo f | xcopy /f /y srcfile destfile
or for those of us just copying large substructures/folders:
use /i which specifies destination must be a directory if copying more than one file
Just to be clear, when you use xcopy /s c:\source d:\target
, put "" around the c:\source and d:\target,otherwise you get error.
ie if there are spaces in the path ie if you have:
"C:\Some Folder\*.txt"
but not required if you have:
C:\SomeFolder\*.txt
@echo off
rem The * at the end of the destination file is to avoid File/Directory Internal Question.
rem You can do this for each especific file. (Make sure you already have permissions to the path)
xcopy /Y "\\Oldeserver\storage\data\MyFile01.txt" "\\New server\storage\data\MyFile01.txt"*
pause
rem You can use "copy" instead of "xcopy "for this example.
My favorite one to backup data is:
ROBOCOPY "C:\folder" "C:\new_folder" /mir
/mir is for mirror. You can also use /mov to move files. It reproduce the exact same folder. It can delete/overwrite files as needed. Works great for me. It's way faster than xcopy / copy. It's built in Windows as well.
Source: http://technet.microsoft.com/en-us/library/cc733145.aspx
You can use esentutl to copy (mainly big) files with a progress bar:
esentutl /y "my.file" /d "another.file" /o
the progress bar looks like this:
Look at rsync
based Windows tool NASBackup. It will be a bonus if you are acquainted with rsync commands.