Skip to content

Instantly share code, notes, and snippets.

@fredimachado
Last active November 14, 2018 11:27
Show Gist options
  • Save fredimachado/cbfe381786ff6b8c6cc448c568e1804b to your computer and use it in GitHub Desktop.
Save fredimachado/cbfe381786ff6b8c6cc448c568e1804b to your computer and use it in GitHub Desktop.
Rename Fortnite replay files removing the 'fixed-' prefix(es)
# !! USE IT AT YOUR OWN RISK !!
#
# Run this script after Fixing the replay files and deleting duplicate ones
# This script will remove the `fixed-` prefix(es) from the files
# NOTE: If you run this before fixing and deleting duplicate files you will get erros due to duplicate files
#
# Script to fix replay files: https://gist.github.com/fredimachado/19a489f6dccdb9e2d18b482bed87059d
# Script to delete duplicate replay files: https://gist.github.com/fredimachado/1a3d36f34e786a423328a347ff11215a
#
# Copy all this content, paste in notepad and save as a ps1 file, example: Rename-Fornite-Replays.ps1
# Then, open the folder containing the script, right click it and choose: Run With Powershell
# If it doesnt run, follow this: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
$LocalAppDataFolder = "$env:LOCALAPPDATA"
$FortniteReplaysFolder = $LocalAppDataFolder + "\FortniteGame\Saved\Demos"
$replayList = New-Object System.Collections.ArrayList
Get-Childitem $FortniteReplaysFolder -Filter fixed-*.replay |
Sort LastWriteTime -Descending |
Foreach-Object {
$newFullName = $_.FullName -replace "(fixed-)", ""
Write-Host "Renaming $($_.FullName) to $newFullName"
Move-Item $_.FullName $newFullName
}
"Press a key..."; $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment