Results 1 to 3 of 3
  • Thread Tools
  1. Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XCopy and Date Stamp On Folder (XP)

    I'm having an issue trying to pass the date to the variable "MyVar" which then will create the subdirectory on Drive E and of course copy the files to it.

    Thanks,
    John

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. New Lounger
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XCopy and Date Stamp On Folder (XP)

    I think you do not need the first line, the myvar variable is set in the second line. What the second line does now is unclear to me. In the third line you need to surround myvar with % symbols.

    This works for me (remove the space between % and A):
    <code>

    for /f "tokens=*" % A in ('Date /T') Do Set myvar=%~nA
    xcopy UNC_To_ServerThisdirectory*.* "E:Storehere%myvar%"
    </code>

    Martin

  4. Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: XCopy and Date Stamp On Folder (XP)

    John

    If the date format of % date% is exactly as you require it, why not just use the single command:

    xcopy UNC_To_ServerThisdirectory*.* E:Storehere% date%

    John

    PS remove the blank between the % and the d of date in each case! I don't think you need the double quotes in the last field, either, so I've left them out...
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •