Script for copying a file to a remote host.

Raymond_Anderson used Ask the Experts™
I am looking for a script that can help me copy a file or set of files into a directory on a remote host.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
         Hi Raymond
                 copy c:\x\*.* \\remotecomputer\remoteshare\

                 *.* indicates all files
               copy c:\x\spesific.txt \\remotecomputer\remoteshare\

                 above copies spesific file.
                You can create a bat file and insert this line in it, then run it whenever you want by double-clicking. Or you can schedule it via scheduled tasks in system tools



Thanks Mr Husy.
If you want a little more secure kind of copy, you can use a little-known Microsoft program called RoboCopy that has a lot more features, such as just specifying a UNC name rather than having to map a network drive.  If the mapping fails, so will copy or xcopy.  You can also use RoboCopy in batch files as Mr. Husy explained.
Robocopy is indeed vastly superior to XCOPY.

You could also consider the freeware SyncBackSE v4 (

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial