In terminal, easy to change all files’s name by this script

Get-ChildItem "C:\Path\To\Folder" -File | ForEach-Object {
    $addText = "-main";
    $nameWithoutExt = [System.IO.Path]::GetFileNameWithoutExtension($_.Name).ToUpper()
    $ext = $_.Extension.ToLower()
    $newName = "$nameWithoutExt-$addText$ext"
    Rename-Item $_.FullName -NewName $newName
}

In example:

  • Uppercase file name
  • Add more text in file name before extension

DMCA.com Protection Status


Leave a Reply

Your email address will not be published. Required fields are marked *