+ Post New Thread
Results 1 to 4 of 4
Windows 7 Thread, making a backup script in Technical; So i googled about a bit and found the following command to drop into a batch file to copy files ...
  1. #1
    mjs_mjs's Avatar
    Join Date
    Jan 2009
    Location
    bexleyheath, london
    Posts
    1,018
    Thank Post
    37
    Thanked 111 Times in 95 Posts
    Rep Power
    37

    making a backup script

    So i googled about a bit and found the following command to drop into a batch file to copy files about, but it doesn't quite work.

    Code:
    xcopy c:\Hornresp\* c:\Hdata\%date:~0,3%\* /Y /Q /S
    I get the following error (in attachment);

    Many thanks to anyone who can shed light on why this might not be working for me.
    Attached Images Attached Images

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,686
    Thank Post
    334
    Thanked 513 Times in 481 Posts
    Rep Power
    178
    Your date formatting isn't correct I'd say. What is it you're trying to show with that?

    Currently you're taking the first 3 letters, aka 02/ 02 is being added, then your / is making the next part a switch. I'm assuming you either want 0,2 or something totally diff?

    Steve
    Last edited by Steve21; 2nd September 2011 at 04:04 PM.

  3. #3


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,710
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    The following will give you the date in YYYY-MM-DD format if that's of any use?

    Code:
    %date:~6,4%-%date:~3,2%-%date:~0,2%

  4. Thanks to Arthur from:

    mjs_mjs (3rd September 2011)

  5. #4
    mjs_mjs's Avatar
    Join Date
    Jan 2009
    Location
    bexleyheath, london
    Posts
    1,018
    Thank Post
    37
    Thanked 111 Times in 95 Posts
    Rep Power
    37
    Quote Originally Posted by Arthur View Post
    The following will give you the date in YYYY-MM-DD format if that's of any use?

    Code:
    %date:~6,4%-%date:~3,2%-%date:~0,2%
    awesome this worked a treat - thanks guys.

SHARE:
+ Post New Thread

Similar Threads

  1. Rar archive with date backup script (.bat)
    By RabbieBurns in forum Scripts
    Replies: 1
    Last Post: 20th November 2009, 02:05 AM
  2. vmWare Backup Script (Server 2, Workstation, possibly ESX)
    By j17sparky in forum Thin Client and Virtual Machines
    Replies: 12
    Last Post: 31st July 2009, 01:29 PM
  3. Help with Backup Script
    By soze in forum Scripts
    Replies: 5
    Last Post: 18th June 2008, 12:12 AM
  4. SIMs backup script after SQL 2005 migration failing...
    By mullet_man in forum MIS Systems
    Replies: 13
    Last Post: 23rd November 2007, 06:03 PM
  5. Backup Script for NT backup and Robocopy
    By ChrisH in forum Scripts
    Replies: 12
    Last Post: 20th October 2005, 01:01 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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