Page 1 of 1

Delete 0 byte files

Posted: 20 Nov 2013 12:06
by pprior
Hi all,
I had a hard drive problem and some of my files were damaged.
I have a backup but from the damaged drive I can still get some information.
So i need to build a script to analize my drive and copy all the content to my backup disk.
The problem is using
xcopy source destination /s /d
I get all the files on the orignal hard drive overwriting the backup files, even the damaged ones with 0 byte size...

So I need first to find and delete those 0 byte files and then copy all the others.

Can you help me?

Re: Delete 0 byte files

Posted: 20 Nov 2013 12:22
by Squashman

Re: Delete 0 byte files

Posted: 20 Nov 2013 12:34
by pprior
Thanks! I've seen it already but i need it to go throug all the folders and first I wanto to run it in "test mode", like creating a text file with all before deleting them.

Re: Delete 0 byte files

Posted: 20 Nov 2013 12:36
by Squashman
Have you read the help for the DIR, FOR and FORFILES commands. All of them have options to recurse into subdirectories.

Re: Delete 0 byte files

Posted: 20 Nov 2013 21:01
by foxidrive
If you are serious about data recovery, and you only have one backup, then you first need to create a second copy of the backup drive - in case the other hard drive fails or becomes corrupted too.

Copying files from a damaged drive onto your only backup is foolish, and from what you've said this is what you plan to do.




I would also make a copy of the damaged drive onto another hard drive too - if it has more up to date files than your backup has.

Re: Delete 0 byte files

Posted: 23 Nov 2013 05:39
by shayanjameel08
They are often put in the "temporary internet files" by some program and when trying to delete an old user profile it prevents the deletion.