So far I have a batch file that renames the file updating the date string in parenthesis. This works fine , but the date could be any number. How do I get the batch to update any date string contained in parentheses.
echo on
for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined MyDate set MyDate=%%x
set today=%MyDate:~0,4%-%MyDate:~4,2%-%MyDate:~6,2%
set "_year=%MyDate:~0,4%"
set "_month=%MyDate:~4,2%"
set "_day=%MyDate:~6,2%"
REN C:\Users\xyz125\Documents\Erics's Docs\scripts\"test file (20150112).txt" "test file (%_year%%_month%%_day%).txt"
pause