MSDOS: How to delete all files with size less than 1K

  • Thread starter Thread starter Maxwell2006
  • Start date Start date
M

Maxwell2006

Hi,



I am working on a MSDOS batch file and I need to delete all files with size
less 1024 bytes.



What DOS command would be the easiest way to do that?



Thanks,

Alan
 
Maxwell2006 said:
Hi,



I am working on a MSDOS batch file and I need to delete all files
with size less 1024 bytes.



What DOS command would be the easiest way to do that?



Thanks,

Alan

I don't know the answer to your question. I don't think it can be done
without using scripting of some sort. You should be using .cmd files rather
than .bat files in XP.
 
Have got following answer from msdos group :
-------------
JRS: In article <[email protected]>, dated Wed, 7
Jun 2006 20:00:32 remote, seen in MoiMeme
is there a way to delete all files smaller ( or bigger) than size x ,
including subfolders ?


On-topic systems cannot do this unaided, except by using WSH for which
the microsoft.public.scripting.* groups are better.

HUNT *.* s p q Z-9876 "del" u

will delete files of 9876 or fewer bytes. Get HUNT via sig line 3.
Omit u for test. You can also use Z=, Z+.

--
© John Stockton, Surrey, UK. [email protected] Turnpike v4.00 MIME.
©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms &
links.
PAS EXE TXT ZIP via
<URL:http://www.merlyn.demon.co.uk/programs/00index.htm>.
Do not Mail News to me. Before a reply, quote with ">" or "> "
(SoRFC1036)

-----------------

Hunt can be found here : http://www.merlyn.demon.co.uk/programs/hunt.zip and
here http://www.merlyn.demon.co.uk/programs/hunt.txt

Good luck !
 
Thanks alot. I'll go with wsh.


MoiMeme said:
Have got following answer from msdos group :
-------------
JRS: In article <[email protected]>, dated Wed, 7
Jun 2006 20:00:32 remote, seen in MoiMeme



On-topic systems cannot do this unaided, except by using WSH for which
the microsoft.public.scripting.* groups are better.

HUNT *.* s p q Z-9876 "del" u

will delete files of 9876 or fewer bytes. Get HUNT via sig line 3.
Omit u for test. You can also use Z=, Z+.

--
© John Stockton, Surrey, UK. [email protected] Turnpike v4.00
MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms &
links.
PAS EXE TXT ZIP via
<URL:http://www.merlyn.demon.co.uk/programs/00index.htm>.
Do not Mail News to me. Before a reply, quote with ">" or "> "
(SoRFC1036)

-----------------

Hunt can be found here : http://www.merlyn.demon.co.uk/programs/hunt.zip
and here http://www.merlyn.demon.co.uk/programs/hunt.txt

Good luck !
 
Back
Top