Taken from the nintendo switch dumping guide wiki (or other new guide)
- Open
cmd.exe
, usecd
to change to the directory of the files you want to merge.- PROTIP: Leaving only the part files here will make this process easier.
- Type
copy /b * name.ext
wherename
is the name you want to give the file and.ext
is the file extension you want to use- e.g.
copy /b * game.xci
- e.g.
- Open the terminal and
cd
into the directory that has the part files - Type
cat * > name.ext
wherename
is the name you want to give the file and.ext
is the file extension you want to use- e.g.
cat * > game.xci
- e.g.
PowerShell Core Script
This isn't thoroughly tested so your mileage may vary. Just copy the contents of this and throw it in your powershell profile or create a file "Merge-Files.ps1" and paste the contents in there to use it. You can use it like so
Merge-Files -Filter "*.xc*" -OutputFile "game.xci"
# Example usage:
# Merge-Files -Filter "*.xc*" -OutputFile "game.xci"
# Merge-Files -Filter "*.mp3" -OutputFile "combined.mp3"
# Merge-Files -Filter "*.mp4" -OutputFile "D:\Videos\combined.mp4" -Path "D:\Downloads"
# Merge-Files -Filter "*.bin" -OutputFile "output.bin"
function Merge-Files {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$OutputFile, # The name of the output file
[Parameter(Mandatory = $false)]
[string]$Path = ".", # Directory containing the partial files (defaults to the current directory)
[Parameter(Mandatory = $false)]
[string]$Filter = "*" # The filter to use (e.g. "*.mp3")
)
try {
# Ensure output file does not already exist
if (Test-Path $OutputFile) {
Write-Error "Output file '$OutputFile' already exists. Please delete or specify a different name."
exit 1
}
# Get all files in the input directory
$partialFiles = Get-ChildItem -Path $Path -Filter $Filter -File | Sort-Object Name
if ($partialFiles.Count -eq 0) {
Write-Error "No files with '$Filter' found in the directory '$Path'."
exit 1
}
# Open the output file in binary write mode
$outputStream = [System.IO.FileStream]::new($OutputFile, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write)
try {
# Buffer size for chunking (e.g., 4 KB)
$bufferSize = 4096
$buffer = New-Object byte[] $bufferSize
foreach ($file in $partialFiles) {
Write-Host "Merging: $($file.Name)"
# Open each input file in binary read mode
$inputStream = [System.IO.FileStream]::new($file.FullName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read)
try {
while (($bytesRead = $inputStream.Read($buffer, 0, $bufferSize)) -gt 0) {
$outputStream.Write($buffer, 0, $bytesRead)
}
}
finally {
$inputStream.Close()
Write-Host "Merged in: $($file.Name)"
}
}
Write-Host "All files merged successfully into '$OutputFile'."
}
finally {
$outputStream.Close()
}
}
catch {
Write-Error "An error occurred: $_"
}
}