The Command Prompt is a powerful tool built into most computers running the Windows operating system. It is a command line interpreter that you may use to perform just about any task, including things like renaming files.

While you may also rename files through File Explorer, doing so in Command Prompt can be much faster if you know how. Additionally, you can also batch rename files in the Command prompt which can massively increase your efficiency.

Rename Files on Command Prompt

The simplest way to rename files inCommand Promptis by going to that specific file’s directory and using theren/renamecommand. Its syntax isrename filename newname.

renamming-files-with-spaces-in-cmd

When using it practically, replace thefilenamewith the file’s actual name andnewnamewith the name you want to set. you may also usereninstead of rename as both are the same command.

However, before you go on to utilize the command, there are a few things to keep in mind.

Now that you know the basic rules to follow when using the rename command, here’s how you may go about using it.

cmd-on-run-3

Additionally, if you don’t like using thecd commandto change your active directory, there is another method you may use. Navigate to the file location inFile Explorer, typecmdin theaddress barand pressEnter. This will directly open Command Prompt in that directory.

Alternatively, you may tweak the rename command a little so that you don’t have to change your directory to rename files. The syntax for this altered command isrename “file path location” newname.

For example,rename “C:\Screenshots\20190213.jpg” “Sun Tzu Quote.jpg”

change-cmd-directory-with-cd

Batch Rename Files on Command Prompt

The best use of the rename command is when you’re trying to rename many files simultaneously. To batch rename files in the Command prompt, you will have to know about the two key wildcards,*and?.

Thecharacter is basically used to select all the files at once, but it is low in priority order. For example, therename Photo.jpg Image*.jpgwill change any image file beginning with the name Screenshot to Image with the same characters following after.

In a nutshell, if your images were labeledPhoto1,Photo2, and so on, the above command will change them toImage1,Image2, and so on.

change-drive-in-command-prompt

If you want to rename files without having to specify their extensions, you may utilize the*wild card to do so as well. For example,rename Untitled.jpg Image.*will ensure that your renamed file has the same extension as its earlier version.

file-path-directions

renaming-files-in-command-prompt-with-the-asterisk

rename-file-extension-without-specifying-extension-in-cmd

rename-file-extension-in-cmd