Răsfoiți Sursa

Update Windows10Debloater.ps1

Richard Newton 6 ani în urmă
părinte
comite
8e137a2e2e
1 a modificat fișierele cu 8 adăugiri și 4 ștergeri
  1. 8 4
      Windows10Debloater.ps1

+ 8 - 4
Windows10Debloater.ps1

@@ -293,10 +293,14 @@ Function Protect-Privacy {
     Stop-Service "DiagTrack"
     Set-Service "DiagTrack" -StartupType Disabled
 
-    Write-Output "Removing CloudStore from registry if it exists"
-    Stop-Process Explorer.exe -Force
-    Remove-Item "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore"
-    Start-Process Explorer.exe -Wait
+    
+     Write-Output "Removing CloudStore from registry if it exists"
+     $CloudStore = 'HKCUSoftware\Microsoft\Windows\CurrentVersion\CloudStore'
+     If (Test-Path $CloudStore) {
+     Stop-Process Explorer.exe -Force
+     Remove-Item $CloudStore
+     Start-Process Explorer.exe -Wait
+   }
 }
 
 Function DisableCortana {