Q:

Check for specific naming convention

I have a directory where users are saving their excel files that should adhere to a specific naming convention:
XX-TestFile.xlsx

where XX is a variable digit and -TestFile.xlsx should always be the same and not change. I'd like to be able to check through a batch job if files in the directory adhere to a specific naming convention.
If filename is misspelled, i.e. XX-TetsFiel.xlsx, XX is not a digit like 02 or even XX-testfile.xlsx (all lowercase), then files should move to an Error directory.
I am using below to move the files to achieve this. I am testing with 11-testFiel.xlsx and it works just fine.
@echo off

for /f "delims=" %%a in ('dir /b *.xlsx ^| findstr /v "[0-9][0-9]-TestFile.xlsx"') do move "%%a" "C:\Temp\Archive\Error"

However, dir /b *.xlsx | findstr /v "[0-9][0-9]-TestFile.xlsx" allows for 109 possible combinations since XX is a variable with two digits like 02. However, I would now only like to check for specific file names of 20 possible digits like 02-TestFile.xlsx, 05-TestFile.xlsx, 10-TestFile.xlsx, etc. This list is fixed... So for example, if file is named 99-TestFile.xlsx I would still like to move it to an Error archive as it is an undesired file name. Can you suggest a solution for this?

A:

Put the valid names into a text file (i.e. "ValidNames.txt") and use findstr with the /G option. 
02-TestFile.xlsx
05-TestFile.xlsx
10-TestFile.xlsx
...

@echo off

for /f "delims=" %%a in ('
    dir /b *.xlsx ^| findstr /vxlg:"ValidNames.txt"
') do move "%%a" "C:\Temp\Archive\Error"

