Skip to content

Instantly share code, notes, and snippets.

@oliveratgithub
Created December 18, 2019 12:30
Show Gist options
  • Save oliveratgithub/c7ca04ce9cea5d3c2319d9c2083c7f49 to your computer and use it in GitHub Desktop.
Save oliveratgithub/c7ca04ce9cea5d3c2319d9c2083c7f49 to your computer and use it in GitHub Desktop.
Batch file rename using PowerShell on Windows: add filename prefix, change file name to all lowercase, and so on.
<# Batch change all PDF file names to lowercase letters within a specific directory #>
dir C:\PATH\TO\FOLDER\*.pdf | Rename-Item -NewName {$_.Name.ToLower()}
<# Batch add prefix to all JPG-images in a specific directory #>
dir C:\PATH\TO\FOLDER\*.jpg | Rename-Item -NewName {"prefix_" + $_.Name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment