batch rename files in windows with powershell

i had a bunch of files in a folder, and i needed to mass-rename them by replacing things. windows doesn't have a way of doing this from explorer (still! even in windows 10!). normally i would open a cygwin shell and do this via bash, but cygwin doesn't mount your network drives (where these files lived).

so, powershell it is.

Dir | Rename-Item –NewName { $_.name –replace "hate","love" }

this replaces all instances of hate with love in the filename. the syntax is actually quite easy to understand, though i loathe the idea of using Title Case for commands. it just looks... ugly.

when i finally stop spending money on other important things (like a new car) i'll buckle down and build a hackintosh and leave windows solely for the htpc. until then, it'll be my daily driver at home.

comments powered by Disqus