Skip to content

Instantly share code, notes, and snippets.

@rajadain
Created October 13, 2019 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajadain/2ad9e49d63118315fbbc714da78e79a7 to your computer and use it in GitHub Desktop.
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
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