Copy folder-files from one location to another including Date-Time stamp?

techresearch7777777 1,766 Reputation points
2021-03-30T21:59:53.563+00:00

Hello, can someone provide me a .bat batch script that I can run that will copy all the contents (files and subfolders) from one local folder to another different location and includes Date-Time stamp to the Hour & Minutes?

i.e. copy "C:\Backups" to different location "\SharedDifferentDisk\Backups_20210330_1500"

And then when I run it again like 15 minutes later the next time it will create another new destination folder like "\SharedDifferentDisk\Backups_20210330_1515"

Any type of free built in copy like xcopy or robocopy or something else is good.

Thanks in advance.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,104 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP
    2021-03-30T23:24:07.703+00:00

    You could use PowerShell to copy the items.
    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-7.1

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

  2. Sunny Qi 10,896 Reputation points Microsoft Vendor
    2021-03-31T08:12:16.237+00:00

    Hi,

    Thanks for posting in Q&A platform.

    Here are some similar thread talking about copying folder to new location with timestamp, you could have a look:

    How to copy folder to new location and give it a timestamp

    Copy the file from one folder to the other and add a time stamp as a suffix when copying batch script

    How to copy an entire folder with current date/time in destination folder name?
    Please Note: Since the websites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.

    Best Regards,
    Sunny

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments