The files to keep are stored in the variable %Exceptions% e.g. "foo bar baz" (generated by another process).
I'd like to keep this as flexible as possible, i.e. the script might exclude 0...n files of totally n matches.
I found an interesting approach dealing with directories, however in that case the exceptions were hardcoded in the script.
I'm also unsure about the underlying algorithm: I'll get the total of files with e.g.
Code: Select all
For /f "delims=" %%f In ('dir /b *.log')
In %Exceptions% each substring represents a file name (foo, bar, baz → foo.log, bar.log, baz.log), separated by whitespace.
Has anyone got an idea?