Ripristinare le policy locali di Windows 10 o in Windows 11 ed eliminare le impostazioni personalizzate
Con questo script è possibile ripristinare le impostazioni di Windows ed eliminare tutte le impostazioni personalizzate impostate tramite policy.
Link per il download del file script reset_policy.bat
Una volta eseguito il file di script (come amministratore) il pc verrà riavviato e tulle le impostazioni gestite da policy verranno eliminate e ripristinate.
E' consigliata la creazione di un backup completo della macchina Windows in uso.
------------------------------------------------------------
@echo off
set backupDir=%userprofile%\Backup_Settings
rem Creare la cartella di backup se non esiste
if not exist "%backupDir%" md "%backupDir%"
rem Eseguire il backup delle impostazioni di registro
reg export HKCU\Software\Microsoft\Windows\CurrentVersion\Policies "%backupDir%\01.reg" /y >nul
reg export HKCU\Software\Policies "%backupDir%\02.reg" /y >nul
reg export HKLM\Software\Microsoft\Policies "%backupDir%\03.reg" /y >nul
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Policies "%backupDir%\04.reg" /y >nul
reg export HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate "%backupDir%\05.reg" /y >nul
reg export HKLM\Software\Policies "%backupDir%\06.reg" /y >nul
reg export HKLM\Software\WOW6432Node\Microsoft\Policies "%backupDir%\07.reg" /y >nul
reg export HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies "%backupDir%\08.reg" /y >nul
reg export HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate "%backupDir%\09.reg" /y >nul
rem Eseguire il backup delle impostazioni
xcopy %windir%\System32\GroupPolicyUsers "%backupDir%\GroupPolicyUsersBackup" /s /e /h /i >nul
xcopy %windir%\System32\GroupPolicy "%backupDir%\GroupPolicyBackup" /s /e /h /i >nul
rem Rimozione delle policy di gruppo
rd %windir%\System32\GroupPolicyUsers /s /q >nul
rd %windir%\System32\GroupPolicy /s /q >nul
gpupdate /force
rem Rimozione delle policy a livello di registro di sistema
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies" /f >nul
reg delete "HKCU\Software\Policies" /f >nul
reg delete "HKLM\Software\Microsoft\Policies" /f >nul
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies" /f >nul
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f >nul
reg delete "HKLM\Software\Policies" /f >nul
reg delete "HKLM\Software\WOW6432Node\Microsoft\Policies" /f >nul
reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" /f >nul
reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f >nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SupportUwpStartupTasks /t REG_DWORD /d 1 /f >nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableFullTrustStartupTasks /t REG_DWORD /d 2 /f >nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableUwpStartupTasks /t REG_DWORD /d 2 /f >nul
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SupportFullTrustStartupTasks /t REG_DWORD /d 1 /f >nul
cls
echo Operazioni completate... Il sistema sara' riavviato nel giro di pochi secondi.
timeout /nobreak /t 5 >nul
shutdown /r /t 0---------------------------------------------------------------
    
        
0 Commenti:
Posta un commento
Iscriviti a Commenti sul post [Atom]
<< Home page