diff --git a/install-windows.ps1 b/install-windows.ps1 index 411a40a..1787686 100644 --- a/install-windows.ps1 +++ b/install-windows.ps1 @@ -150,8 +150,14 @@ function Backup-ExistingConfig { $backupDir = Join-Path $env:USERPROFILE ".claude-backup-$(Get-Date -Format 'yyyyMMdd_HHmmss')" if (Test-Path $claudeDir) { - Copy-Item -Path $claudeDir -Destination $backupDir -Recurse -Force - Write-ColorOutput "Backup created at: $backupDir" -Type Success + # Use Robocopy to handle reserved device names (nul, con, prn, etc.) + $robocopyResult = robocopy $claudeDir $backupDir /E /R:0 /W:0 /NFL /NDL /NJH /NJS 2>&1 + + if ($LASTEXITCODE -lt 8) { + Write-ColorOutput "Backup created at: $backupDir" -Type Success + } else { + Write-ColorOutput "Backup had some issues (continued anyway)." -Type Warning + } } else { Write-ColorOutput "No existing configuration to backup." -Type Info }