Powershell ile Bilgisayarını Temizle
PowerShell ile Sistem Temizliği ve Windows Süresi Uzatma Aracı
Bilgisayarınızı hızlandırmak ve Windows’un deneme süresini uzatmak için harika bir PowerShell script’i hazırladım! Bu script, sisteminizde gereksiz dosyaları temizlemenizi ve bazı Windows sorunlarını çözmenizi sağlar.
Script Nedir ve Ne İşe Yarar?
Bu PowerShell script’i, 4 temel işlem yapar:
- Prefetch Temizleme: Prefetch klasöründeki gereksiz dosyaları temizler, bilgisayarınızın performansını artırır.
- Geri Dönüşüm Kutusunu Temizleme: Silinen dosyaları geri dönüşüm kutusundan tamamen kaldırır ve daha fazla alan açar.
- Test Mode Kapatma: Windows işletim sistemindeki “Test Mode” yazısını kaldırır.
- Windows Deneme Süresini Uzatma:
slmgr /rearm
komutuyla Windows’un deneme süresini bir süre daha uzatmanızı sağlar.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
# Form oluştur
$form = New-Object System.Windows.Forms.Form
$form.Text = “Sistem Temizleyici ve Windows Süresi Uzatma”
$form.Size = New-Object System.Drawing.Size(450, 350)
$form.StartPosition = “CenterScreen”
# Bilgilendirici Label ekle
$label = New-Object System.Windows.Forms.Label
$label.Text = “Lütfen yapmak istediğiniz işlemi seçin:”
$label.AutoSize = $true
$label.Location = New-Object System.Drawing.Point(100, 20)
$form.Controls.Add($label)
# Prefetch Temizle Butonu
$prefetchButton = New-Object System.Windows.Forms.Button
$prefetchButton.Text = “Prefetch’i Temizle”
$prefetchButton.Size = New-Object System.Drawing.Size(300, 50)
$prefetchButton.Location = New-Object System.Drawing.Point(75, 60)
$prefetchButton.Add_Click({
$prefetchPath = “$env:SystemRoot\Prefetch”
if (Test-Path -Path $prefetchPath) {
Remove-Item -Path “$prefetchPath\*” -Force -Recurse
[System.Windows.Forms.MessageBox]::Show(“Prefetch klasörü başarıyla temizlendi.”, “Başarılı”)
} else {
[System.Windows.Forms.MessageBox]::Show(“Prefetch klasörü bulunamadı.”, “Hata”)
}
})
$form.Controls.Add($prefetchButton)
# Geri Dönüşüm Kutusunu Temizle Butonu
$recycleBinButton = New-Object System.Windows.Forms.Button
$recycleBinButton.Text = “Geri Dönüşüm Kutusunu Temizle”
$recycleBinButton.Size = New-Object System.Drawing.Size(300, 50)
$recycleBinButton.Location = New-Object System.Drawing.Point(75, 120)
$recycleBinButton.Add_Click({
try {
Clear-RecycleBin -Force -ErrorAction SilentlyContinue
[System.Windows.Forms.MessageBox]::Show(“Geri Dönüşüm Kutusu başarıyla temizlendi.”, “Başarılı”)
} catch {
[System.Windows.Forms.MessageBox]::Show(“Geri Dönüşüm Kutusu temizlenirken bir hata oluştu.”, “Hata”)
}
})
$form.Controls.Add($recycleBinButton)
# Test Mode’u Kapat Butonu
$testModeButton = New-Object System.Windows.Forms.Button
$testModeButton.Text = “Windows Etkinleştir Yazısını Kaldır”
$testModeButton.Size = New-Object System.Drawing.Size(300, 50)
$testModeButton.Location = New-Object System.Drawing.Point(75, 180)
$testModeButton.Add_Click({
try {
Start-Process -FilePath “bcdedit” -ArgumentList “-set testsigning off” -Verb RunAs
[System.Windows.Forms.MessageBox]::Show(“Test Mode devre dışı bırakıldı. Lütfen sistemi yeniden başlatın.”, “Başarılı”)
} catch {
[System.Windows.Forms.MessageBox]::Show(“Test Mode kapatılamadı. Yönetici yetkisiyle çalıştırmayı deneyin.”, “Hata”)
}
})
$form.Controls.Add($testModeButton)
# Deneme Süresini Uzat Butonu
$extendTrialButton = New-Object System.Windows.Forms.Button
$extendTrialButton.Text = “Deneme Süresini Uzat”
$extendTrialButton.Size = New-Object System.Drawing.Size(300, 50)
$extendTrialButton.Location = New-Object System.Drawing.Point(75, 240)
$extendTrialButton.Add_Click({
try {
Start-Process -FilePath “slmgr” -ArgumentList “/rearm” -Verb RunAs
[System.Windows.Forms.MessageBox]::Show(“Windows deneme süresi başarıyla uzatıldı. Lütfen sistemi yeniden başlatın.”, “Başarılı”)
} catch {
[System.Windows.Forms.MessageBox]::Show(“Deneme süresi uzatılamadı. Yönetici yetkisiyle çalıştırmayı deneyin.”, “Hata”)
}
})
$form.Controls.Add($extendTrialButton)
# “Kapat” Butonu
$closeButton = New-Object System.Windows.Forms.Button
$closeButton.Text = “Kapat”
$closeButton.Size = New-Object System.Drawing.Size(300, 50)
$closeButton.Location = New-Object System.Drawing.Point(75, 300)
$closeButton.Add_Click({
$form.Close()
})
$form.Controls.Add($closeButton)
# Formu göster
$form.ShowDialog()