1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

.bat to copy files based on today's date

Discussion in 'DOS/Other' started by seperelli, Dec 21, 2011.

Thread Status:
Not open for further replies.
  1. seperelli

    seperelli Thread Starter

    Dec 21, 2011
    I needed some help and found the this thread but needed some extra help.
    here you go:

    For the date: http://blueonionsoftware.com/blog.aspx?p=40656a9d-021b-4061-b296-36ad5211f4b2

    my file:
    set day=%DATE:~3,2%
    set month=%DATE:~6,2%
    set year=%DATE:~9,4%
    echo today is: %date%
    set all=%month%-%day%-%year%
    xcopy "C:\*.* "T:\" /d:%all%

    i used the echo %date% to see what date i had and then i used this to get the day, month and year.

  2. Squashman

    Squashman Trusted Advisor

    Apr 4, 2003
    You haven't really specified what you are having problems with. Nor have you specified if you are receiving some type of error message when you run this batch file. As far as I can tell you are doing it correctly
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Similar Threads - copy files based
  1. niedernsill
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1032238

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice