Skip to content

Instantly share code, notes, and snippets.

@bdonvr
Created June 6, 2024 06:58
Show Gist options
  • Save bdonvr/8d27ab76650b07c72f180158cef5adf2 to your computer and use it in GitHub Desktop.
Save bdonvr/8d27ab76650b07c72f180158cef5adf2 to your computer and use it in GitHub Desktop.
@echo off
setlocal EnableDelayedExpansion
:: Get today's date in DD-MM-YYYY format
for /f "tokens=1-3 delims=/" %%a in ('date /t') do (
set _day=%%a
set _month=%%b
set _year=%%c
)
:: Rename files containing 'FDD' or 'MP'
for %%i in (*FDD*.*) do ren "%%i" "8851 FDD !_day!-!_month!-!_year!.xlsx"
for %%i in (*MP*.*) do ren "%%i" "8851 MP !_day!-!_month!-!_year!.xlsx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment