@echo off echo Resim indiriliyor... powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$server = 'servername'; $database = 'databasename'; $user = 'sa'; $password = 'şifre';" ^ "$cs = 'Data Source=' + $server + ';Initial Catalog=' + $database + ';User ID=' + $user + ';Password=' + $password + ';TrustServerCertificate=True;MultipleActiveResultSets=True;';" ^ "$query = 'SELECT TOP 1 profilResmi FROM users WHERE profilResmi IS NOT NULL';" ^ "$conn = New-Object System.Data.SqlClient.SqlConnection $cs; $conn.Open();" ^ "$cmd = $conn.CreateCommand(); $cmd.CommandText = $query;" ^ "$reader = $cmd.ExecuteReader();" ^ "if ($reader.Read()) { $b64 = $reader.GetString(0).Trim(); if (![string]::IsNullOrEmpty($b64)) { $bytes = [Convert]::FromBase64String($b64); if (!(Test-Path 'C:\cc')) { New-Item -Path 'C:\cc' -ItemType Directory | Out-Null }; [System.IO.File]::WriteAllBytes('C:\cc\profilResmi.png', $bytes); Write-Output '✅ Resim C:\cc\profilResmi.png olarak indirildi.' } else { Write-Output '⚠️ Base64 veri boş.' } } else { Write-Output '⚠️ Kayıt bulunamadı.' };" ^ "$reader.Close(); $conn.Close()" echo İşlem tamamlandi. pause |