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
Money_Saver
Posts: 364 Forumite
in Techie Stuff
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
@echo off
xcopy j:\*.* k:\ /m /e /y/
Thanks
Regards,
Money Saver
Money Saver
0
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.0
-
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!!
> . !!!! ----> .0 -
You might find something like FreeFileSync to be easier and/or faster and/or more reliable that using a batch file...0
-
0
-
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?
ThanksRegards,
Money Saver0 -
are you using /c to skip past the error?
not really anything to worry about, it's just the rights on recycle bin!!
> . !!!! ----> .0 -
Yes, I've just removed it and now it's not presenting like before.
Thanks for your help!Regards,
Money Saver0 -
-
It may be that you have missed off the /s to copy subfolders. I know that /e is supposed to do this but ...Money_Saver wrote: »@echo off
xcopy j:\*.* k:\ /m /e /y/
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:
Repeated for wife's documents and shared folder.echo *** MY Documents ****
xcopy "C:\Documents and Settings\Dave\My Documents"\*.* Z:\Backups\Dave /s /m /d /y
Hope this helps, Dave0 -
dont really need the /m, with the /d and /s/e!!
> . !!!! ----> .0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
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