Renaming or Replacing multiple file names in a folder - The Fast way -Windows 10
Suppose we have many files in a folder with similar pattern and we want to rename all of them. Doing this manually using explorer or command prompt is very time consuming. For example we have following files stored in d:\Products\ folder:
scean1-160_x_90.jpg
scean1-240_x_135.jpg
scean1-320_x_180.jpg
scean1-480_x_270.jpg
scean1-640_x_360.jpg
scean1-960_x_540.jpg
scean1-1280_x_720.jpg
scean1-1920_x_1080.jpg
screen1-2560_x_1440.jpg
screen1-3840_x_2160.jpg
scean1-5120_x_2880.jpg
We want to change the common string pattern "_x_" to "x".
Easiest way to do this in Windows 10. Useing Windows Power Shell open the folder and execute the following command:
get-childitem | foreach { rename-item $_ $_.Name.Replace("_x_", "x") }
Comments
Post a Comment