Computing.Net > Forums > Programming > Delete 0KB file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Delete 0KB file

Reply to Message Icon

Name: AudioFox
Date: February 17, 2009 at 13:22:38 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

First off let me say that I am new to
programing. What I need is just a single line
command or a simple command that I can add to
my batch file that will delete service.dat if
it equals 0KB.

If filename.ext == 0kb DEL filename.ext

Thank you for your time.



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: February 17, 2009 at 14:24:33 Pacific
Reply:

for %%f in (filename.ext) do if %%~zf == 0 del %%f

For more information on how this works, type

for /?


0
Reply to Message Icon

Related Posts

See More


Windows Vista re-installa... Running A VB6 EXE in the ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Delete 0KB file

Need batch file to delete old files www.computing.net/answers/programming/need-batch-file-to-delete-old-files/14092.html

SQl delete temp files code... www.computing.net/answers/programming/sql-delete-temp-files-code/12257.html

deleting a file with CBuilderX www.computing.net/answers/programming/deleting-a-file-with-cbuilderx/12046.html