Upload files to "/"

This commit is contained in:
2026-07-21 14:02:01 +02:00
parent 060dfad252
commit 1a732e98e2
2 changed files with 87 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
# KillWindowsUpdate.ps1
# Wymaga uruchomienia z uprawnieniami Administratora
#Requires -RunAsAdministrator
Write-Host "Trwa ostateczne pacyfikowanie Windows Update w rejestrze..." -ForegroundColor Cyan
Write-Host "----------------------------------------------------"
# 1. Zablokowanie Windows Update Medic Service (WaaSMedicSvc)
Write-Host "[1/3] Blokowanie usługi WaaSMedicSvc..." -NoNewline
try {
$medicPath = "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc"
if (Test-Path $medicPath) {
Set-ItemProperty -Path $medicPath -Name "Start" -Value 4 -Type DWord -Force
Write-Host " GOTOWE" -ForegroundColor Green
} else {
Write-Host " BRAK KLUCZA" -ForegroundColor Yellow
}
} catch {
Write-Host " BŁĄD" -ForegroundColor Red
}
# 2. Polityka GPO: NoAutoUpdate = 1
Write-Host "[2/3] Wymuszanie braku aktualizacji przez polityki (NoAutoUpdate)..." -NoNewline
try {
$auPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
if (-not (Test-Path $auPath)) {
New-Item -Path $auPath -Force -Recurse | Out-Null
}
Set-ItemProperty -Path $auPath -Name "NoAutoUpdate" -Value 1 -Type DWord -Force
Write-Host " GOTOWE" -ForegroundColor Green
} catch {
Write-Host " BŁĄD" -ForegroundColor Red
}
# 3. OPCJA NUKLEARNA: Usunięcie kluczy usług (Odkomentuj, jeśli chcesz tego użyć)
# Zastosowanie tego sprawi, że usługi całkowicie znikną z systemu.
<#
Write-Host "[3/3] Usuwanie usług wuauserv i UsoSvc z rejestru..." -NoNewline
try {
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\UsoSvc" -Recurse -Force -ErrorAction SilentlyContinue
Write-Host " GOTOWE (Usunięto)" -ForegroundColor Green
} catch {
Write-Host " BŁĄD" -ForegroundColor Red
}
#>
Write-Host "----------------------------------------------------"
Write-Host "Zablokowano. Pamiętaj o restarcie systemu!" -ForegroundColor Cyan
+38
View File
@@ -0,0 +1,38 @@
# OptimizeVhdServices.ps1
# Wymaga uruchomienia z uprawnieniami Administratora
#Requires -RunAsAdministrator
Write-Host "Wyłączanie usług Update i sprawdzania dysku..." -ForegroundColor Cyan
Write-Host "----------------------------------------------------"
# 1. Wyłączanie mechanizmów aktualizacji
Write-Host "[1/2] Wyłączanie Windows Update (wuauserv) i UsoSvc..." -NoNewline
try {
# Najpierw siłowo zatrzymujemy usługi (jeśli działają)
Stop-Service -Name "wuauserv", "UsoSvc" -Force -ErrorAction SilentlyContinue
# Zmieniamy tryb startu na "Wyłączony"
Set-Service -Name "wuauserv" -StartupType Disabled -ErrorAction Stop
Set-Service -Name "UsoSvc" -StartupType Disabled -ErrorAction Stop
Write-Host " GOTOWE" -ForegroundColor Green
} catch {
Write-Host " BŁĄD" -ForegroundColor Red
Write-Host " Szczegóły: $_" -ForegroundColor Red
}
# 2. Wyłączanie automatycznego sprawdzania dysku (Chkdsk) na partycji C:
Write-Host "[2/2] Wyłączanie auto-sprawdzania dysku C: (chkntfs)..." -NoNewline
try {
# Używamy natywnego narzędzia systemowego chkntfs
# Przełącznik /X oznacza "eXclude", czyli wyklucz podany dysk z autocheck
Start-Process -FilePath "chkntfs.exe" -ArgumentList "/x c:" -Wait -NoNewWindow
Write-Host " GOTOWE" -ForegroundColor Green
} catch {
Write-Host " BŁĄD" -ForegroundColor Red
Write-Host " Szczegóły: $_" -ForegroundColor Red
}
Write-Host "----------------------------------------------------"
Write-Host "Optymalizacja VHD zakończona!" -ForegroundColor Cyan