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

    Joined:
    Dec 21, 2011
    Messages:
    1
    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
    xcopy:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

    my file:
    @ECHO OFF
    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%
    @pause

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

    Regards,
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    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!

Loading...
Similar Threads - copy files based
  1. niedernsill
    Replies:
    3
    Views:
    419
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