26 Sept 2019

how to rename the multiple filenames in windows | Using Command Prompt



You could also try using PowerShell, a powerful Windows command line tool. You'd run this command:


Open the CMD and go to the file location 

then 

Enter "PowerShell"


Full Command:

get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace("Radiohead -", "") }
Analyzing it:
get-childitem *.mp3
This lists all files whose names end with .mp3.  They are then piped to the next command with the | operator.
foreach { rename-item $_ $_.Name.Replace("Radiohead -", "") }
This replaces all instances of Radiohead - with nothing, denoted by "", effectively wiping the word from all the files in the directory.

You could also modify get-childitem *.mp3 to get-childitem – that would rename all the files in the directory, not just files whose names end with .mp3.