Header Ads

Bulk Rename File/ Folder by Command Line (TUT Mass File Rename)

If you need a powerful way to rename multiple files or folders at once - without any third-party utility then this article is exact what you need. In this article, I will show you how to bulk rename (mass rename) thousands of files or folders by a single Command Line. And more, Windows Explorer also has a great feature that help us bulk rename files or folders. Combining with a powerful Command Line in PowerShell, you can customize any flexible name you want.
Bulk Rename File/ Folder by Command Line (TUT Mass File Rename)

Why we don't use third-party software utilities?

There are many third-party software utilities that help you mass rename files, folders very easily. Most popular utilities are: Bulk Rename UtilityAdvanced Renamer, Rename-It!, Fast File Renamer or Lupas Rename. But installing many too programs/ software may cause our computers slow down, hang or crash (untrusted software may even harm our computers).

So, why we have to use third-party utilities while we can bulk rename files, folders with one Command Line? (That is Windows built-in)

Bulk Rename File/ Folder by Command Line (TUT Mass File Rename)

Windows comes with a variety of "built-in" ways to rename multiples files or/and folders at once, includes Windows Explorer, DOS Command Prompt, and PowerShell. To help you easy to understand this Guide, I will give 2 popular use-cases (examples) as below:
Ex1. Change all file extensions: We have 1000 TXT files in a folder and we want to change all to HTML files; or we have 1000 PNG files wanna change to JPG files
Ex2. Change complex file name in bulk: We have a bunch of files or folders which we want to name sequentially, for example, we have 1000 beautiful images and we want to name it from New-File-Name-1.JPG to New-File-Name-1000.JPG

1. Change All file Extension by a Command Line

With example 1, we can do it easily by using the command line REN: REN *.PNG *.JPG (or REN *.TXT *.HTML):

- In Windows Explorer => goto menu File => Open Command Prompt => Open Command Prompt
Change All file Extension by a Command Line
- Type the command above in Command Prompt window
Type the command above in Command Prompt window

2. Bulk Rename files or folders in Windows Explorer

Windows Explorer is a quick way to rename multiple files or folders at once, but not many people know and use it:
- Select all files/ folders you want to rename (or you may use the shortcut: Ctrl + A)
- Hold the pointer to the first file/ folder then select Rename from the Context Menu  (or you may use the shortcut: F2)
- Type new file name (for example: "New-File-Name")  then press Enter to save it.
Done ! Now Windows Explorer will auto rename all the selected files/ folders sequentially, from New-File-Name (1).JPG to New-File-Name (1000).JPG
Bulk Rename files or folders in Windows Explorer

3. Mass Files, Folders Rename by Windows PowerShell Command Line

- Mass rename files, folders in Windows Explorer is a very fast and easy method. But lacking in flexibility => PowerShell is extremely flexible.
- To open PowerShell in Windows, you search "PowerShell" from the Start Menu => then select Windows PowerShell.
Mass Files, Folders Rename by Windows PowerShell Command Line
 - After launching PowerShell window, type the below Command Line:
3.1. Change to the folder contains files or folders that you want to rename:
cd D:\a\media\files\2016\10\
3.2. Remove the bracket in the file name (New-File-Name (1).JPG will change to New-File-Name-1.JPG)
dir | rename-item -NewName { $_.name.Replace(” (“,”–“) }
=> This command line will remove character ” (“ from all the file name.
dir | rename-item -NewName { $_.name.Replace(“)“,””) }
=> This command line will remove character ”)“ from all the file name.
Done.
Mass Files, Folders Rename by Windows Powershell Command Line
Hope you enjoy it.
Please leave a comment if you need further help.

No comments:

EasyTipz. Powered by Blogger.