Maybe someone finds this useful:
This is the Powershell script I use to backup my MQ config into a zip file. I use Windows Task Scheduler to run it once per week. My destination drive is cloud storage.
- Requires 7zip.
- Change your source and destination folders.
- Put the code in a new text file and save it as a .ps1 file
- Set up a scheduled task
- Make the action start a program (powershell.exe)
- Add this to the arguments: -ExecutionPolicy Bypass -NonInteractive -file "P:\Backups\Backup Next Config.ps1" (change the path to wherever you save the ps1 file.
This is the Powershell script I use to backup my MQ config into a zip file. I use Windows Task Scheduler to run it once per week. My destination drive is cloud storage.
- Requires 7zip.
- Change your source and destination folders.
- Put the code in a new text file and save it as a .ps1 file
- Set up a scheduled task
- Make the action start a program (powershell.exe)
- Add this to the arguments: -ExecutionPolicy Bypass -NonInteractive -file "P:\Backups\Backup Next Config.ps1" (change the path to wherever you save the ps1 file.
Bash:
# ============================================================
# Backup-Next-Config.ps1
# Compresses the Next Config folder using 7-Zip
# and saves it as YYYY-MM-DD-NextConfig.7z
# ============================================================
# --- Configuration -----------------------------------------------------------
$SourceFolder = "C:\Games\Next\config"
$BackupFolder = "P:\Backups\EQ" # Change this to your preferred backup destination
$SevenZipPath = "C:\Program Files\7-Zip\7z.exe" # Change if 7-Zip is installed elsewhere
# --- Validation --------------------------------------------------------------
if (-not (Test-Path $SevenZipPath)) {
Write-Error "7-Zip not found at: $SevenZipPath`nPlease install 7-Zip or update the `$SevenZipPath variable."
exit 1
}
if (-not (Test-Path $SourceFolder)) {
Write-Error "Source folder not found: $SourceFolder"
exit 1
}
# Create backup destination folder if it doesn't exist
if (-not (Test-Path $BackupFolder)) {
New-Item -ItemType Directory -Path $BackupFolder | Out-Null
Write-Host "Created backup folder: $BackupFolder"
}
# --- Build archive name and path ---------------------------------------------
$DateStamp = Get-Date -Format "yyyy-MM-dd"
$ArchiveName = "$DateStamp-Next-Config.7z"
$ArchivePath = Join-Path $BackupFolder $ArchiveName
# --- Run 7-Zip ---------------------------------------------------------------
Write-Host "Starting backup..."
Write-Host " Source : $SourceFolder"
Write-Host " Archive: $ArchivePath"
Write-Host ""
& $SevenZipPath a -t7z -mx=5 "$ArchivePath" "$SourceFolder\*"
# --- Result ------------------------------------------------------------------
if ($LASTEXITCODE -eq 0) {
$Size = (Get-Item $ArchivePath).Length / 1MB
Write-Host ""
Write-Host "Backup completed successfully!" -ForegroundColor Green
Write-Host " File : $ArchivePath"
Write-Host (" Size : {0:N2} MB" -f $Size)
} else {
Write-Error "7-Zip exited with code $LASTEXITCODE. Backup may have failed."
exit $LASTEXITCODE
}

