Home

IT Free Tools Blog

Blog

How to Rename file extensions in bulk using PowerShell?

Open PowerShell as Admin
Right-click the Start menu → Windows PowerShell (Admin).
 

Run This Script

$folder = "C:\Path\To\Your\Folder"  # Replace with your folder path Get-ChildItem -Path $folder -Recurse -File |    Where-Object { $_.Extension -ne '.txt' } |    Rename-Item -NewName { $_.BaseName + '.txt' } -Verbose


Instructions:
Replace C:\Path\To\Your\Folder with the actual path to your target folder.