I followed https://stackoverflow.com/a/16129486/2000557 's example and modified the script for a folder of video files.
@echo off
Setlocal enabledelayedexpansion
Set "Pattern=."
Set "Replace=_"
For %%a in (*.avi) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
For %%a in (*.mkv) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
For %%a in (*.mp4) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
Pause&Exit
Can anyone explain why this also replaces the last dot in the filename (that is a part of the extension) into an underscore. this feels like I was given the fish and not taught how to fish. this script works, but sadly it replaces the last period also.
I'd like to use the script without having to turn on Hide Extensions.