$dir = "$env:USERPROFILE\Desktop\LR4"
$sevenZip = "$env:ProgramFiles\7-Zip\7z.exe"
$archive = "$dir\LR4_transport_AES256.zip"
$password = "LR4-Transfer!26"
$files = @(
"$dir\LR4_Word_3.docx",
"$dir\LR4_Excel_3.xlsx",
"$dir\LR4_FINAL_PROTECTED.pdf"
)
foreach ($file in $files) {
if (-not (Test-Path $file)) {
throw "File not found: $file"
}
}
if (Test-Path $archive) {
Remove-Item $archive
}
& $sevenZip a -tzip -mem=AES256 "-p$password" `
$archive $files
if ($LASTEXITCODE -ne 0) {
throw "Archive creation failed"
}
& $sevenZip t "-p$password" $archive
if ($LASTEXITCODE -ne 0) {
throw "Archive verification failed"
}
Write-Host "SUCCESS: AES-256 ZIP created"
Write-Host "Password: $password"
explorer.exe $dir