How do I remove unnecessary dots in a file name in a windows batch script eg:
a.b.c.txt to a.txt
The info contained in the SS64 link that Charlie Wilson posted originated from my SU post: How does the Windows RENAME command interpret wildcards?. Unfortunately there isn't any simple REN syntax that can do what you want.
You will have to resort to at least one FOR loop. Here is one solution that works from the command prompt as long as none of your file names begin with
You can protect names that begin with
You can run either of the above commands from a batch file by changing all
The ren command. There is a very detailed explanation of using this command with wildcards at the link below.