@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