Your problem is explained well here: https://ss64.com/nt/for_f.html
The relevant part says:
By default, /F breaks up each line within the file at each blank space
" ", and any blank lines are skipped, this default parsing behavior
can be changed by applying one or more of the "options" parameters.
The option(s) must be contained "within quotes"
The way to do that in your case is to tell for
that it should not consider spaces as delimiters, in fact you don't want any delimiters:
for /f "delims=" %%F in ('dir /b /a-d ^| findstr /vile ".zip"') do echo "%%F"
(I changed the command to echo
, since I don't want careless people accidentally deleting files because you or I made a mistake :) - once you convinced yourself it's good, change it back to del
)
Edit: updated to include quotes in command, as indicated in comments.