I know there are many examples of this but I just can't get it and this shouldn't be THAT difficult but I am finding it to be.
I have a folder with 4 files in it:
rtcc_current_pnp_data1-2018-12-26-061000.txt
rtcc_current_pnp_data2-2018-12-26-061000.txt
rtcc_current_pnp_data3-2018-12-26-061000.txt
rtcc_current_pnp_data4-2018-12-26-061000.txt
the date/time at the end changes daily.
Each day I want to run a batch file to rename these to:
data1.txt
data2.txt
data3.txt
data4.txt
That's it...can someone please help me extract the correct name from the files and rename them?
So I tried this and it doesn't do anything:
for %%A in (\\apdwhdb01\D$\ProbationImportFolder\Current\rtcc*.*) do (
set "filename=%%A"
set "newName=EXP_!filename:~18!"
rem ** remove the ECHO when it seems to work
ren !filename! !newName!
)