34 lines
1.4 KiB
PowerShell
34 lines
1.4 KiB
PowerShell
# Uninstall.ps1
|
|
# Script to uninstall the folder backup context menu integration
|
|
|
|
# Check for admin rights
|
|
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
if (-not $isAdmin) {
|
|
Write-Host "Bu komut dosyasý yönetici ayrýcalýklarý gerektirir. Lütfen Yönetici olarak çalýþtýrýn." -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "Klasör Yedekleme Sað Týk Menüsü Entegrasyonu Kaldýrýlýyor..." -ForegroundColor Yellow
|
|
|
|
# Define registry paths
|
|
$FolderContextMenuPath = "Registry::HKEY_CLASSES_ROOT\Directory\shell\BackupFolder"
|
|
$BackgroundContextMenuPath = "Registry::HKEY_CLASSES_ROOT\Directory\Background\shell\BackupFolder"
|
|
|
|
try {
|
|
# Remove folder context menu entry
|
|
if (Test-Path $FolderContextMenuPath) {
|
|
Remove-Item -Path $FolderContextMenuPath -Recurse -Force
|
|
Write-Host "Klasör sað týk menüsü girdisi kaldýrýldý" -ForegroundColor Green
|
|
}
|
|
|
|
# Remove background context menu entry
|
|
if (Test-Path $BackgroundContextMenuPath) {
|
|
Remove-Item -Path $BackgroundContextMenuPath -Recurse -Force
|
|
Write-Host "Arka plan sað týk menüsü girdisi kaldýrýldý" -ForegroundColor Green
|
|
}
|
|
|
|
Write-Host "Kaldýrma iþlemi baþarýyla tamamlandý!" -ForegroundColor Green
|
|
}
|
|
catch {
|
|
Write-Host "Kaldýrma iþlemi sýrasýnda hata oluþtu: $($_.Exception.Message)" -ForegroundColor Red
|
|
} |