Page 1 of 1

Rename only first 2 characters

Posted: 15 Oct 2018 12:58
by bmatt8
I need to rename only the first 2 characters of a filename. What command would I use without using powershell/python/etc... Hopefully just use the REN command.

Re: Rename only first 2 characters

Posted: 15 Oct 2018 13:35
by dbenham
To set the first two characters of all files in the current directory to XX:

Code: Select all

ren *.* XX*
See How does the Windows RENAME command interpret wildcards? over at StackExchange SuperUser for an explanation as to why this works.


Dave Benham