#1 23 Aug 2016 15:02

New Member
Registered: 23 Aug 2016
Posts: 1

Delete all but specific file

I am trying to run a command that will search a bunc h of folders and DELETE ALL files EXCEPT a specific file.

I am using this right now.

for %i in (*) do if not %i == .msg del %i

1. This does not work on subfolders.  How do I modify it to do so?
2. How do I specify more than one type of file to KEEP (right now only the .msg are kept)

PLEASE HELP!!!!!  Cheers


#2 24 Aug 2016 15:05

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 867

Re: Delete all but specific file

see this previous thread


Board footer

Powered by FluxBB