I am trying to use a for loop to rename a file
::@Echo Off
setlocal enableDelayedExpansion
::Set Date
set mydate=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
::Rename file
for %%F in (D:\Data\*.bak) do (
ren %%F D:\Data\prod_live_Full_%mydate%0000.Lts.bak
)
I keep getting invalid command error. Any help is appreciated.