Most of times we need to transfer folders/files to different locations like today I got a request to copy backup files between network locations. When tried DOS then understood that DOS can’t recognize UNC paths (network paths like \\dirname\foldername). So when searched found command called ‘ROBOCOPY’, this will help in transferring files between network locations.
Above command will copy only files from 1 to 2. Robocopy has several options which helps in copying subfolders, attributes and so on.
To copy all files and subfolders we can use \S \E.
robocopy D:\Backup \\testserver\sqlbackup$\ AdventureWorks.bak
Refer below links for detailed information.