Wildcard in batch file
I was wondering how to check a group file in a batch file
SET /p project=Enter project (XYZ_2016_123)
I need to check if there is a variable project in XYZ_20 format ?? _ 123 where ?? two digits. Ignore the XYZ and 123 part of the entry. At the moment I have a lot of applications to check if there is a year. But I was wondering if it can be done using wildcards?
s=%project%
if not x%s:XYZ_2016_123=%==x%s% GOTO MAIN
if not x%s:XYZ_2017_123=%==x%s% GOTO MAIN
if not x%s:XYZ_2018_123=%==x%s% GOTO MAIN
:: etc.
+3
source to share