I know this is a strange requirement, but people out there if watching movies might need this when they share the movies through Media Player for streaming purpose.
We requires 2 paths to do this
- A PowerShell script to rename file and a batch script to click and run this PowerShell Script -> to rename the filename
- Foobar Software – a free opensource -> to rename the title of the file
The PowerShell script is as follows ( Copy Paste the below to your notepad and change the paramenters as required, Save the file as *.ps1 )
$dir = cmd /c dir /b
$dir | ForEach-Object { cmd /c ren $_ ($_ -replace ‘[|]’) }
Get-ChildItem *.mkv | Rename-Item -NewName { $_.Name -replace ‘www.yourfilename.change – ‘,” }
Get-ChildItem *.mkv | Rename-Item -NewName { $_.Name -replace ‘1080p’,” }
Get-ChildItem *.mkv | Rename-Item -NewName { $_.Name -replace ‘UNTOUCHED’,” }
Get-ChildItem *.log
Make sure you put the above file to the directory where u want to change the filenames, You can add as many lines on the above Get-Childitem with replace command to replace the required filename strings as you desires
Now the Batch File to run the Powershell script, as you dont want to copy paste the Powershell script to the powershell everytime, so copy the below command (dont forget to change the filename of the powershell with the name of yours) to a notepad and save it as *.bat file
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& ‘D:\Downloads\rename-ps.ps1′”
Now run the batch File and you will see the results.
Now the second part foobar2000, i am just putting the screenshots only
- Open Foobar
- Now click on File -> Add Files -> Select at the bottom filter by (All Files)
- Now right click the File
![](https://engineeronnetwork.wordpress.com/wp-content/uploads/2023/04/image.png?w=469)
Once you Click on Properties below screen will appear and click on Tools and Click on Automatically Fill Values
![](https://engineeronnetwork.wordpress.com/wp-content/uploads/2023/04/image-1.png?w=582)
As per the screenshot below change the pattern to %title% and then click ok Ok Save and you are Done
![](https://engineeronnetwork.wordpress.com/wp-content/uploads/2023/04/image-2.png?w=536)
Attached below word document has the script file embedded inside the zip file, you can download and edit those file directly