Hi,
I have files like this;
-7237435.txt
223435.txt
23435.txt
-33415.txt
323435.txt
etc
I need a batch file which can delete below 300000 number txt files and keep 300000 higher number files only. In this case keep only 323435.txt only and delete rest all files.
Thanks you
Delete 300000 below value number txt files
Moderator: DosItHelp
Re: Delete 300000 below value number txt files
This is untested and assumes that all .txt files have numbers for names and that none exceed 2^31
Code: Select all
@echo off
for %%a in (*.txt) do if %%~na LSS 300000 del "%%a"
Re: Delete 300000 below value number txt files
foxidrive wrote:This is untested and assumes that all .txt files have numbers for names and that none exceed 2^31Code: Select all
@echo off
for %%a in (*.txt) do if %%~na LSS 300000 del "%%a"
