Robocopy syntax

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
falcios
Posts: 43
Joined: 02 Mar 2017 05:38

Robocopy syntax

#1 Post by falcios » 07 Jul 2021 16:58

This is a sample batch file.

This script copies a file from the source with one name and in the destination it is a different name.

copy "c:\users\test\sample.txt" "d:\test\sample july 2021.txt"

Can Robocopy do this, copy file from source with one name and the destination with a different name?
If so, what is the syntax to do this?

Thanks in advance.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Robocopy syntax

#2 Post by Squashman » 07 Jul 2021 19:02

Nope. The Syntax is pretty clear from the help file.

Code: Select all

              Usage :: ROBOCOPY source destination [file [file]...] [options]
             source :: Source Directory (drive:\path or \\server\share\path).
        destination :: Destination Dir  (drive:\path or \\server\share\path).
               file :: File(s) to copy  (names/wildcards: default is "*.*").

Post Reply