Created
October 13, 2019 12:51
-
-
Save rajadain/2ad9e49d63118315fbbc714da78e79a7 to your computer and use it in GitHub Desktop.
Renames .MP4 files from Samsung Galaxy S10 filename style to Dropbox "Camera Upload" filename style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem "." -Filter "*.mp4" | Foreach-Object { | |
$year = $_.BaseName.Substring(0, 4) | |
$month = $_.BaseName.Substring(4, 2) | |
$day = $_.BaseName.Substring(6, 2) | |
$hour = $_.BaseName.Substring(9, 2) | |
$minute = $_.BaseName.Substring(11, 2) | |
$second = $_.BaseName.Substring(13, 2) | |
$newName = "$($year)-$($month)-$($day) $($hour).$($minute).$($second)" | |
Rename-Item -Path $_.FullName -NewName "$($newName).mp4" | |
# Write-Output "$($_.BaseName) -> $($newName)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment