-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReverter.ps1
More file actions
169 lines (143 loc) · 8.45 KB
/
Reverter.ps1
File metadata and controls
169 lines (143 loc) · 8.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Solicitar UAC al Usuario (Privilegios de Administrador) - Necesario para revertir las optimizaciones.
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
Exit
}
#########
# UI PERSONALIZADA
#########
Write-Host " ========================================================= " -ForegroundColor Black -BackgroundColor Red
Write-Host " = BIENVENIDO AL ASISTENTE DE REVERSION DE OPTIMIZACION = " -ForegroundColor Black -BackgroundColor Red
Write-Host " ========================================================= " -ForegroundColor Black -BackgroundColor Red
Write-Host " = = "
Write-Host " = - Revertir optimizacion del equipo. = "
Write-Host " = = "
Write-Host " = - Restaurar Bloware de Microsoft. = "
Write-Host " = = "
Write-Host " = - Habilitar Cortana. = "
Write-Host " = = "
Write-Host " = - Habilitar Bing Box del Buscador. = "
Write-Host " = = "
Write-Host " = - Activar el Firewall de Windows. = "
Write-Host " = = "
Write-Host " = - Activar Windows Defender. = "
Write-Host " = = "
Write-Host " = Edit by_ Denis.G (Devnis) = "
Write-Host " = = "
Write-Host " ========================================================= " -ForegroundColor Black -BackgroundColor Red
Write-Host " = Presiona una tecla para aplicar la Cura... = " -ForegroundColor Black -BackgroundColor Red
Write-Host " ========================================================= " -ForegroundColor Black -BackgroundColor Red
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
##########
# Revertir Opciones de Privacidad
##########
# Habilitar Telemetría
Write-Host "Habilitando Telemetría..."
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
# Habilitar Compartir Wi-Fi
Write-Host "Habilitando Compartir Wi-Fi..."
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
# Habilitar Bing del buscador de Windows
Write-Host "Habilitando Bing del Buscador..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 1
# Habilitar Seguimiento de Ubicación
Write-Host "Habilitando Seguimiento de Ubicación..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
# Habilitar Feedback MS
Write-Host "Habilitando Feedback..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 1
# Habilitar Rastreadores ID
Write-Host "Habilitando Rastreador de ID..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 1
# Habilitar Cortana
Write-Host "Habilitando Cortana..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 1
# Restaurar AutoLogger
Write-Host "Restaurando AutoLogger..."
icacls $autoLoggerDir /remove:d SYSTEM | Out-Null
# Habilitar Servicios de Tracking
Write-Host "Habilitando Servicio de Rastreo..."
Set-Service "DiagTrack" -StartupType Automatic
Start-Service "DiagTrack"
# Habilitar Servicios WAP
Write-Host "Habilitando servicio WAP..."
Set-Service "dmwappushservice" -StartupType Automatic
Start-Service "dmwappushservice"
##########
# Revertir Optimizaciones de Servicios
##########
# Activar Windows Firewall (Recomendado).
Set-NetFirewallProfile -Profile * -Enabled True
# Activar Windows Defender - (Recomendado).
Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
##########
# Revertir Optimizaciones de UI
##########
# Habilitar el bloqueo de pantalla.
Write-Host "Habilitando el bloqueo de pantalla..."
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 0
# Desactivar la vista de extensiones para los archivos.
Write-Host "Desactivando vista de extensiones para archivos..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
##########
# Reinstalar Apps De Windows Base.
##########
# Reinstalar OneDrive
Write-Host "Reinstalando OneDrive..."
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
If (!(Test-Path $onedrive)) {
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
}
Start-Process $onedrive -NoNewWindow -Wait
# Reinstalar Aplicaciones Basura de MS.
Write-Host "Reinstalando aplicaciones de Windows..."
Get-AppxPackage -AllUsers | Foreach {
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"
}
# Reinstalar Cortana.
Write-Host "Reinstalando Cortana..."
Get-AppxPackage -AllUsers Microsoft.549981C3F5F10 | Foreach {
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"
}
# Restaurar el fondo de pantalla predeterminado.
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop\' -Name 'Wallpaper' -Value '%SystemRoot%\web\wallpaper\Windows\img0.jpg'
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
# Eliminar la clave del Delay de Inicio.
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize"
if (Test-Path $registryPath) {
Remove-ItemProperty -Path $registryPath -Name "StartupDelayInMSec" -Force
}
# Restaurar las opciones de rendimiento.
$performanceKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"
$settingsKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
Set-ItemProperty -Path $performanceKey -Name "VisualFXSetting" -Value 0
Set-ItemProperty -Path $settingsKey -Name "ListviewAlphaSelect" -Value 1
Set-ItemProperty -Path $settingsKey -Name "TaskbarAnimations" -Value 1
Set-ItemProperty -Path $settingsKey -Name "ListviewShadow" -Value 1
Set-ItemProperty -Path $settingsKey -Name "MenuAnimations" -Value 1
Set-ItemProperty -Path $settingsKey -Name "ListviewWatermark" -Value 1
Set-ItemProperty -Path $settingsKey -Name "ComboBoxAnimation" -Value 1
Set-ItemProperty -Path $settingsKey -Name "CursorShadow" -Value 1
Set-ItemProperty -Path $settingsKey -Name "DragFullWindows" -Value 1
Set-ItemProperty -Path $settingsKey -Name "FontSmoothing" -Value 2
Set-ItemProperty -Path $settingsKey -Name "ShowSounds" -Value 0
Set-ItemProperty -Path $settingsKey -Name "SmoothScroll" -Value 1
Set-ItemProperty -Path $settingsKey -Name "ThemeActive" -Value 1
Set-ItemProperty -Path $settingsKey -Name "Wallpaper" -Value '%SystemRoot%\web\wallpaper\Windows\img0.jpg'
Set-ItemProperty -Path $settingsKey -Name "WebView" -Value 1
Set-ItemProperty -Path $settingsKey -Name "WindowAlphaChannel" -Value 1
Set-ItemProperty -Path $settingsKey -Name "WindowAnimations" -Value 1
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
##########
# Reinicio.
##########
Write-Host
Write-Host "Presiona cualquier tecla para reiniciar..." -ForegroundColor Black -BackgroundColor White
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host "Reiniciando..."
Restart-Computer