Windows dosyalarını tekrar Bootlu ISO haline getirin isimli sordum.net makalesindeki 2.yönteme göre oluşturulmuş powershell betiğimizdir.
Güle güle kullanın....
KOD İÇERİĞİ : (Windows ISO Oluşturucusu.ps1)
Kod: Tümünü seç
# ISO oluşturma betiği (PowerShell)
# "Equilibrium tarafından hazırlanmıştır."
# 1) oscdimg.exe konumunu belirle
$defaultOscdimg = "C:\Windows\System32\oscdimg.exe"
if (Test-Path $defaultOscdimg -PathType Leaf) {
$oscdimgPath = $defaultOscdimg
Write-Host "oscdimg bulundu: $oscdimgPath" -ForegroundColor Green
} else {
$oscdimgPath = Read-Host "oscdimg.exe bulunamadı. Lütfen tam yolunu girin (örn: D:\ADK\oscdimg.exe)"
# Kullanıcıdan alınan yol kontrolü
if (-Not (Test-Path $oscdimgPath -PathType Leaf)) {
Write-Host "HATA: Geçerli bir oscdimg.exe dosyası verilmedi!" -ForegroundColor Red
exit
}
if (-Not ($oscdimgPath.ToLower().EndsWith("oscdimg.exe"))) {
Write-Host "HATA: Belirtilen dosya oscdimg.exe değil!" -ForegroundColor Red
exit
}
}
# 2) Kullanıcıdan kaynak klasör yolunu al
$sourcePath = Read-Host "Windows medya klasörünün tam yolunu girin (örn: C:\windows_11)"
# 3) Kullanıcıdan çıktı ISO yolunu al
$isoPath = Read-Host "Oluşturulacak ISO dosyasının tam yolunu girin (örn: C:\Win11_TR.iso)"
# 4) Boot dosyası konumu
$bootFile = Join-Path $sourcePath "boot\etfsboot.com"
# Kontroller
if (-Not (Test-Path $sourcePath -PathType Container)) {
Write-Host "HATA: Kaynak klasör bulunamadı!" -ForegroundColor Red
exit
}
if (-Not (Test-Path $bootFile -PathType Leaf)) {
Write-Host "HATA: Boot sektörü dosyası (etfsboot.com) bulunamadı!" -ForegroundColor Red
exit
}
# 5) ISO etiket adı (varsayılan Türkçe sürüm)
$label = "WIN_TR_DVD"
$customLabel = Read-Host "ISO etiketi (boş bırakılırsa varsayılan = $label)"
if ($customLabel -ne "") {
$label = $customLabel
}
# 6) oscdimg parametreleri
$arguments = @(
"-b$bootFile"
"-h"
"-u2"
"-m"
"-l$label"
"`"$sourcePath`""
"`"$isoPath`""
)
# 7) Komutu çalıştır
Write-Host "ISO oluşturuluyor, lütfen bekleyin..."
Start-Process -FilePath $oscdimgPath -ArgumentList $arguments -Wait -NoNewWindow
# 8) İşlem sonucu
if (Test-Path $isoPath -PathType Leaf) {
Write-Host "ISO başarıyla oluşturuldu: $isoPath" -ForegroundColor Green
} else {
Write-Host "HATA: ISO dosyası oluşturulamadı!" -ForegroundColor Red
}





