We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

batch file

When I run my batch file to copy the contents from my pc to my external hard drive, it copies everything but the folders are empty. Can someone tell me where I have gone wrong please? Obviously I need the contents of the folders included in the back up.

@echo off
xcopy j:\*.* k:\ /m /e /y/


Thanks
Regards,

Money Saver

«1

Comments

  • Don't use /M. That's telling it to only copy files with the archive attribute set. I suspect your files don't have it set.
  • closed
    closed Posts: 10,886 Forumite
    edited 5 December 2012 at 12:28PM
    try /s/e/d/h/c/y

    that will copy all new or updated files, including subdirectories and contents apart from open files.

    using xcopy as a method of backup on it's own could potentially result in data loss, for example if your originals got corrupted or infected, you will copy that corruption across too, also not much use for a windows/programs backup, disk imaging with macrium reflect free could do the lot in one go
    !!
    > . !!!! ----> .
  • esuhl
    esuhl Posts: 9,409 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    You might find something like FreeFileSync to be easier and/or faster and/or more reliable that using a batch file...
  • aerostar
    aerostar Posts: 1,738 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Combo Breaker
    This works quite well

    http://www.nchsoftware.com/backup/index.html

    and free
  • Thanks to everyone who has helped.

    When I run the batch file I am presented with the following:

    Access denied
    Unable to create directory - K:\$RECYCLE.BIN

    Anyone know how to remove this entry?

    Thanks
    Regards,

    Money Saver

  • closed
    closed Posts: 10,886 Forumite
    are you using /c to skip past the error?

    not really anything to worry about, it's just the rights on recycle bin
    !!
    > . !!!! ----> .
  • Yes, I've just removed it and now it's not presenting like before.

    Thanks for your help!
    Regards,

    Money Saver

  • closed
    closed Posts: 10,886 Forumite
    !!
    > . !!!! ----> .
  • Dave_C_2
    Dave_C_2 Posts: 1,827 Forumite
    edited 5 December 2012 at 8:37PM
    @echo off
    xcopy j:\*.* k:\ /m /e /y/
    It may be that you have missed off the /s to copy subfolders. I know that /e is supposed to do this but ...

    Don't know what the last / is for and there should at least be a space before it.

    The first run through should be without the /m to get the first copy done, thereafter the /m will do the incremental backups.

    This works for me:
    echo *** MY Documents ****
    xcopy "C:\Documents and Settings\Dave\My Documents"\*.* Z:\Backups\Dave /s /m /d /y
    Repeated for wife's documents and shared folder.

    Hope this helps, Dave
  • closed
    closed Posts: 10,886 Forumite
    dont really need the /m, with the /d and /s/e
    !!
    > . !!!! ----> .
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455.1K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 603K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.