|I am very new to batch files. Could someone help me in renaming a text file in a folder.|
I have many text files in the folder D:\folders\files
the text files will be like textfile_yyyymmdd.txt
filename_yyyymmdd.txt, on running a batch file i should be able to rename the files to rename the files as textfile.txt filename.txt
I tried using the batch script
for %%i in (*) do (set fname=%%i) & call:rename
ren "%fname%" "%fname:~0,-9%"
but by running this script i am losing the file extension.could anyone please help me overcoming this error