|I know how to do this based upon either of the criteria by itself, but Im not sure how to use them in conjunction.|
I have an FTP folder where a vendor uploads some reports every night. I need to create a script that will select the most recently created report whose file name begins with "CustomExports_2" (the rest of the filename is a system generated time/date stamp).
I know to do a partial name match, you can do this "%CustomExports_2%" as the selector, but this would return several dozen files.
I know to do the date, you could use a token like this:
for /f "tokens="" %%a in ('dir /b /od *.csv 2^>NUL') do set lastmod=%%a
But that wouldn't filter out the other custom reports (i.e CustomExports_1).
How do I do these together, and make it poop out a file named "Output.csv"?