for do if

J

j4e8a16n

Hi everybody,

I have many images in a folder and I want to delete 4 files every
five files . That is to say keeping only one fift of the images
files.


set a=0
for /r %i in (*.png) do if %a% LSS 5 (set /a a+=1 & del "%i" ) else
(set /a a=0)

The variable a does not seem to be set to zero has if %a% keeps
increasing

Thanks for yur attention,

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top