-1

I want to create a batch file that should delete only 0 KB file. I have created a batch but it also delete file of 1 KB. So please help me out with perfect suggestions to delete only 0 KB. I used below code but it also delete 1 KB file.

for /r %%F in (EDC*.*) do if %%~zF LSS 1000 del "%%F"
NoNaMe
  • 6,020
  • 30
  • 82
  • 110
Vinay
  • 1
  • 1
  • welcome to stackoverflow. here you can ask your question and queries but its required to show your efforts which you gave on your question ... so can you please show what you tried so far for this ? – user1140237 Jan 23 '16 at 05:51
  • What do you mean by "0 KB"? Windows Explorer (and most other systems) consider 1 kilobyte = 1,024 bytes (2^10). – Serge Jan 23 '16 at 06:26
  • 0KB i mean file like txt files. – Vinay Jan 23 '16 at 07:08
  • 2
    You should check the size of the files by opening the respective property pages, so you see it in terms of Bytes; you will notice that Windows Explorer only displays 0K for empty files (such with a size of 0 Bytes); then you should rethink your question and check whether it makes sense as it is now... – aschipfl Jan 23 '16 at 08:54

1 Answers1

0
@for /r %%F in (*.*) do @if %%~zF equ 0 echo "%%F"

Your code says less than 1000 bytes. This is equal to 0.

bgalea
  • 41
  • 2