

Hit Shift and right click an empty space within that folder.Ĥ. Open the folder that contains the files you want to rename.Ģ. Windows will now take that name and rename all files the same but with a numbered suffix.ġ.

Highlight all the files you want to change, right click and select rename.Ĥ. Order them how you want them to be ordered.ģ. Open the folder containing the files in Windows Explorer.Ģ. You can use a third-party program to do it for you or use Windows itself to rename.ġ. If you have a selection of files you need to rename but don’t feel like going through them individually, there is a simple way to rename them en masse. What but if you could batch rename files and extensions in Windows 10? Wouldn’t that make organization easier?īulk rename files and extensions in Windows 10 Keeping them tidy and in some semblance of order can be very time consuming. The number of slashes maps to yyyy-mm-dddd in the file name.Īs an example this will rename a file in posts/ yyyy/ yyyy-mm-dddd-slug/ yyyy-mm-dddd-slug.mdx to posts/ yyyy/ yyyy-mm-dddd-slug/ slug.md.If you have had your computer for a while, you will likely have hundreds, if not thousands of images, documents and other stuff on your drive. The / drops 1 character from the filename. This is not exactly what we wanted, so let's use another REN command. ~nxA: Expands the value stored in parameter A to a filename and extensionĪs an example this will rename a file in posts/ yyyy/ yyyy-mm-dddd-slug/index.mdx to posts/ yyyy/ yyyy-mm-dddd-slug/ yyyy-mm-dddd-slug.mdx.Line 3: renames the MDX file to the parent directory name.

Line 2: Loop through the parent directory for the MDX file.Line 1: Loops through all the MDX files recursively and set the value to a parameter.You can start using the REN (rename) command to update the filename to the parent directory name. Now, I could do it one by one or find a utility but using a single command is more elegant. I wanted to updated this to posts/ yyyy/ yyyy-mm-dddd-slug/slug.md. As part of the migration from Gatsby to Statiq, I had to rename all the files with the extension mdx to md.įor the posts, the mdx file lived in a directory structure similar to posts/ yyyy/ yyyy-mm-dddd-slug/index.mdx.
