This commit is contained in:
2025-05-27 16:46:04 -06:00
4 changed files with 190 additions and 75 deletions

View File

@@ -1,55 +1,68 @@
@echo off
setlocal
echo ==========================================
echo Aplicando configuración institucional...
echo ==========================================
:: ============================
:: CARGAR HIVE NTUSER.DAT COMO default_profile
:: ============================
echo 🔄 Montando hive NTUSER.DAT...
reg load "HKU\default_profile" "C:\Users\Default\NTUSER.DAT"
if %errorlevel% neq 0 (
echo ❌ Error cargando NTUSER.DAT. ¿Ya está montado o no tienes permisos?
goto :EOF
)
:: ========================================================= :: =========================================================
:: TECLADO :: TECLADO
:: ========================================================= :: =========================================================
reg add "HKU\default_profile\Control Panel\Keyboard" /v InitialKeyboardIndicators /t REG_DWORD /d 2 /f reg add "HKU\default_profile\Control Panel\Keyboard" /v InitialKeyboardIndicators /t REG_DWORD /d 2 /f
reg add "HKCU\Control Panel\Keyboard" /v InitialKeyboardIndicators /t REG_DWORD /d 2 /f
:: ========================================================= :: =========================================================
:: SEGURIDAD Y CONTROL DE USUARIO :: SEGURIDAD Y CONTROL DE USUARIO
:: ========================================================= :: =========================================================
:: Desactivar almacenamiento de contraseñas en Edge
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v PasswordManagerEnabled /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v PasswordManagerEnabled /t REG_DWORD /d 0 /f
:: Deshabilitar la ejecución automática de unidades USB
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f
:: Ocultar unidad C: en el explorador
reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDrives /t REG_DWORD /d 4 /f reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDrives /t REG_DWORD /d 4 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDrives /t REG_DWORD /d 4 /f
:: Deshabilitar edición del registro por usuarios
reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t REG_DWORD /d 1 /f reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t REG_DWORD /d 1 /f
:: Ocultar panel de control y configuración
reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoControlPanel /t REG_DWORD /d 1 /f reg add "HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoControlPanel /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoControlPanel /t REG_DWORD /d 1 /f
:: ========================================================= :: =========================================================
:: RENDIMIENTO Y MANTENIMIENTO :: RENDIMIENTO Y MANTENIMIENTO
:: ========================================================= :: =========================================================
:: Deshabilitar Windows Tips para nuevos usuarios
reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v DisableSoftLanding /t REG_DWORD /d 1 /f reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v DisableSoftLanding /t REG_DWORD /d 1 /f
:: Deshabilitar servicios de telemetría
reg add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f reg add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /v AllowTelemetry /t REG_DWORD /d 0 /f
:: Desactivar sugerencias de inicio de apps en el menú inicio
reg add "HKU\default_profile\Software\Policies\Microsoft\Windows\Explorer" /v NoStartMenuSuggestions /t REG_DWORD /d 1 /f reg add "HKU\default_profile\Software\Policies\Microsoft\Windows\Explorer" /v NoStartMenuSuggestions /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v NoStartMenuSuggestions /t REG_DWORD /d 1 /f
:: Desactivar reinicio automático después de actualizaciones
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f
:: ========================================================= :: =========================================================
:: MANTENER EQUIPOS LIMPIOS Y REINICIADOS :: MANTENER EQUIPOS LIMPIOS Y REINICIADOS
:: ========================================================= :: =========================================================
:: Limpiar archivos temporales al cerrar sesión (Disk Cleanup estilo)
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files" /v StateFlags0001 /t REG_DWORD /d 2 /f reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files" /v StateFlags0001 /t REG_DWORD /d 2 /f
:: Habilitar borrado automático de perfiles de usuario inactivos tras 30 días
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DeleteUserProfilesOlderThan /t REG_DWORD /d 30 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DeleteUserProfilesOlderThan /t REG_DWORD /d 30 /f
:: Establecer tiempo máximo inactivo antes de cerrar sesión (en segundos)
reg add "HKU\default_profile\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 600 /f reg add "HKU\default_profile\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 600 /f
reg add "HKU\default_profile\\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 1 /f reg add "HKU\default_profile\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 1 /f
reg add "HKCU\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 600 /f
reg add "HKCU\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 1 /f
:: ============================
:: DESMONTAR HIVE
:: ============================
echo 🔄 Desmontando hive...
reg unload "HKU\default_profile"
echo ✅ Configuración aplicada a default user y usuario actual.
pause

View File

@@ -1,89 +1,118 @@
@echo off @echo off
setlocal
echo ================================ echo ================================
echo Configurando tema, fondo y protector de pantalla... echo Configurando tema, fondo y navegador institucional...
echo ================================ echo ================================
:: ============================
:: CARGAR HIVE NTUSER.DAT COMO default_profile
:: ============================
echo 🔄 Montando hive NTUSER.DAT...
reg load "HKU\default_profile" "C:\Users\Default\NTUSER.DAT"
if %errorlevel% neq 0 (
echo ❌ Error al montar NTUSER.DAT. ¿Ya está cargado o faltan permisos?
goto :EOF
)
:: ============================ :: ============================
:: OCULTAR CONFIGURACIÓN DE PERSONALIZACIÓN :: OCULTAR CONFIGURACIÓN DE PERSONALIZACIÓN
:: ============================ :: ============================
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop" /v NoChangingWallPaper /t REG_DWORD /d 1 /f for %%K in (
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoThemesTab /t REG_DWORD /d 1 /f "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop"
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoControlPanel /t REG_DWORD /d 0 /f "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoPersonalization /t REG_DWORD /d 1 /f ) do (
reg add %%K /v NoChangingWallPaper /t REG_DWORD /d 1 /f
reg add %%K /v NoThemesTab /t REG_DWORD /d 1 /f
reg add %%K /v NoControlPanel /t REG_DWORD /d 0 /f
reg add %%K /v NoPersonalization /t REG_DWORD /d 1 /f
)
:: ============================ :: ============================
:: OCULTAR LA PÁGINA DE CONFIGURACIÓN DE PANTALLA DE BLOQUEO :: OCULTAR LA PANTALLA DE BLOQUEO
:: ============================ :: ============================
reg add "HKLM\Software\Policies\Microsoft\Windows\Personalization" /v NoLockScreen /t REG_DWORD /d 0 /f reg add "HKLM\Software\Policies\Microsoft\Windows\Personalization" /v NoLockScreen /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DisableLogonBackgroundImage /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DisableLogonBackgroundImage /t REG_DWORD /d 0 /f
:: ============================ :: ============================
:: DESACTIVAR ANIMACIONES :: DESACTIVAR ANIMACIONES
:: ============================ :: ============================
reg add "HKU\default_profile\Control Panel\Desktop\WindowMetrics" /v MinAnimate /t REG_SZ /d 0 /f reg add "HKU\default_profile\Control Panel\Desktop\WindowMetrics" /v MinAnimate /t REG_SZ /d 0 /f
reg add "HKCU\Control Panel\Desktop\WindowMetrics" /v MinAnimate /t REG_SZ /d 0 /f
:: ============================ :: ============================
:: Sin Widgets :: SIN WIDGETS
:: ============================ :: ============================
reg add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f
:: ============================ :: ============================
:: TEMA OSCURO :: TEMA OSCURO
:: ============================ :: ============================
set KEY_THEME_CUR="HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" set KEY_THEME_DEF="HKU\default_profile\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
reg add %KEY_THEME_CUR% /v AppsUseLightTheme /t REG_DWORD /d 0 /f set KEY_THEME_CUR="HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
reg add %KEY_THEME_CUR% /v SystemUsesLightTheme /t REG_DWORD /d 0 /f
reg add %KEY_THEME_CUR% /v ColorPrevalence /t REG_DWORD /d 1 /f
:: ============================================ for %%K in (%KEY_THEME_DEF% %KEY_THEME_CUR%) do (
:: FONDO DE PANTALLA Y PROTECTOR reg add %%K /v AppsUseLightTheme /t REG_DWORD /d 0 /f
:: ============================================ reg add %%K /v SystemUsesLightTheme /t REG_DWORD /d 0 /f
set KEY_DESKTOP="HKU\default_profile\Control Panel\Desktop" reg add %%K /v ColorPrevalence /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v LockScreenImage /t REG_SZ /d "C:\shared\img0.jpg" /f )
reg add %KEY_DESKTOP% /v WallPaper /t REG_SZ /d "C:\shared\img0.jpg" /f
reg add %KEY_DESKTOP% /v ScreenSaveActive /t REG_SZ /d 0 /f
:: ============================================ :: ============================
:: EDGE Y NAVEGACIÓN :: FONDO Y PROTECTOR
:: ============================================ :: ============================
set KEY_EDGE="HKU\default_profile\Software\Policies\Microsoft\Edge" set IMG_PATH="C:\shared\img0.jpg"
reg add %KEY_EDGE% /v HideFirstRunExperience /t REG_DWORD /d 1 /f for %%K in (
reg add %KEY_EDGE% /v BrowserSignin /t REG_DWORD /d 0 /f "HKU\default_profile\Control Panel\Desktop"
reg add %KEY_EDGE% /v SyncDisabled /t REG_DWORD /d 0 /f "HKCU\Control Panel\Desktop"
reg add %KEY_EDGE% /v ExtensionInstallBlocklist /t REG_MULTI_SZ /d "*" /f ) do (
reg add %%K /v WallPaper /t REG_SZ /d %IMG_PATH% /f
reg add %%K /v ScreenSaveActive /t REG_SZ /d 0 /f
)
:: -------------------------------------------- reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v LockScreenImage /t REG_SZ /d %IMG_PATH% /f
set KEY_EDGE_LOCAL="HKCU\Software\Policies\Microsoft\Edge" :: ============================
:: EDGE - PERFIL DEFAULT Y ACTUAL
:: ============================
set KEY_EDGE_DEF="HKU\default_profile\Software\Policies\Microsoft\Edge"
set KEY_EDGE_CUR="HKCU\Software\Policies\Microsoft\Edge"
set PAGE_LOCATION="https://www.google.com" set PAGE_LOCATION="https://www.google.com"
:: Página de inicio y comportamiento de arranque
reg add %KEY_EDGE_LOCAL% /v HomepageLocation /t REG_SZ /d %PAGE_LOCATION% /f
reg add %KEY_EDGE_LOCAL% /v HomepageIsNewTabPage /t REG_DWORD /d 0 /f
reg add %KEY_EDGE_LOCAL% /v ShowHomeButton /t REG_DWORD /d 1 /f
reg add %KEY_EDGE_LOCAL% /v RestoreOnStartup /t REG_DWORD /d 4 /f
reg add %KEY_EDGE_LOCAL%\RestoreOnStartupURLs /v 1 /t REG_SZ /d %PAGE_LOCATION% /f
:: Configuración de privacidad y seguridad for %%K in (%KEY_EDGE_DEF% %KEY_EDGE_CUR%) do (
reg add %KEY_EDGE_LOCAL% /v AddressBarMicrosoftSearchInBingProviderEnabled /t REG_DWORD /d 0 /f reg add %%K /v HideFirstRunExperience /t REG_DWORD /d 1 /f
reg add %KEY_EDGE_LOCAL% /v AdsSettingForIntrusiveAdsSites /t REG_DWORD /d 2 /f reg add %%K /v BrowserSignin /t REG_DWORD /d 0 /f
reg add %KEY_EDGE_LOCAL% /v ClearCachedImagesAndFilesOnExit /t REG_DWORD /d 1 /f reg add %%K /v SyncDisabled /t REG_DWORD /d 0 /f
reg add %KEY_EDGE_LOCAL% /v ConfigureDoNotTrack /t REG_DWORD /d 1 /f reg add %%K /v ExtensionInstallBlocklist /t REG_MULTI_SZ /d "*" /f
reg add %KEY_EDGE_LOCAL% /v SmartScreenEnabled /t REG_DWORD /d 1 /f reg add %%K /v HomepageLocation /t REG_SZ /d %PAGE_LOCATION% /f
reg add %KEY_EDGE_LOCAL% /v SmartScreenPuaEnabled /t REG_DWORD /d 1 /f reg add %%K /v HomepageIsNewTabPage /t REG_DWORD /d 0 /f
reg add %KEY_EDGE_LOCAL% /v EdgeShoppingAssistantEnabled /t REG_DWORD /d 0 /f reg add %%K /v ShowHomeButton /t REG_DWORD /d 1 /f
reg add %%K /v RestoreOnStartup /t REG_DWORD /d 4 /f
reg add %%K\RestoreOnStartupURLs /v 1 /t REG_SZ /d %PAGE_LOCATION% /f
reg add %%K /v AddressBarMicrosoftSearchInBingProviderEnabled /t REG_DWORD /d 0 /f
reg add %%K /v AdsSettingForIntrusiveAdsSites /t REG_DWORD /d 2 /f
reg add %%K /v ClearCachedImagesAndFilesOnExit /t REG_DWORD /d 1 /f
reg add %%K /v ConfigureDoNotTrack /t REG_DWORD /d 1 /f
reg add %%K /v SmartScreenEnabled /t REG_DWORD /d 1 /f
reg add %%K /v SmartScreenPuaEnabled /t REG_DWORD /d 1 /f
reg add %%K /v EdgeShoppingAssistantEnabled /t REG_DWORD /d 0 /f
reg add %%K /v NewTabPageSetFeedType /t REG_DWORD /d 1 /f
reg add %%K /v DefaultSearchProviderEnabled /t REG_DWORD /d 1 /f
reg add %%K /v DefaultSearchProviderName /t REG_SZ /d "Google" /f
reg add %%K /v DefaultSearchProviderSearchURL /t REG_SZ /d "%PAGE_LOCATION%/search?q={searchTerms}" /f
reg add %%K /v DefaultSearchProviderSuggestURL /t REG_SZ /d "%PAGE_LOCATION%/complete/search?output=chrome&q={searchTerms}" /f
)
:: Página nueva pestaña (feed de contenido) :: ============================
reg add %KEY_EDGE_LOCAL% /v NewTabPageSetFeedType /t REG_DWORD /d 1 /f :: BLOQUEO MICROSOFT STORE
:: ============================
:: Motor de búsqueda predeterminado (Google)
reg add %KEY_EDGE_LOCAL% /v DefaultSearchProviderEnabled /t REG_DWORD /d 1 /f
reg add %KEY_EDGE_LOCAL% /v DefaultSearchProviderName /t REG_SZ /d "Google" /f
reg add %KEY_EDGE_LOCAL% /v DefaultSearchProviderSearchURL /t REG_SZ /d "%PAGE_LOCATION%/search?q={searchTerms}" /f
reg add %KEY_EDGE_LOCAL% /v DefaultSearchProviderSuggestURL /t REG_SZ /d "%PAGE_LOCATION%/complete/search?output=chrome&q={searchTerms}" /f
:: Sin Microsoft Store
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v NoUseStoreOpenWith /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v NoUseStoreOpenWith /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v RemoveWindowsStore /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v RemoveWindowsStore /t REG_DWORD /d 1 /f
:: ============================
:: DESMONTAR HIVE
:: ============================
echo 🔄 Desmontando hive...
reg unload "HKU\default_profile"
echo ✅ Configuración aplicada a usuario actual y perfil por defecto.
pause

73
ejecutar_politicas.c Normal file
View File

@@ -0,0 +1,73 @@
#include <windows.h>
#include <stdio.h>
void copiarImagen() {
const char* origen = "img0.jpg";
const char* destinoDir = "C:\\Shared";
const char* destino = "C:\\Shared\\img0.jpg";
DWORD attr = GetFileAttributesA(origen);
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) {
printf("🖼️ Copiando imagen institucional a %s...\n", destino);
CreateDirectoryA(destinoDir, NULL);
if (CopyFileA(origen, destino, FALSE)) {
printf("✅ Imagen copiada correctamente.\n");
} else {
printf("❌ Error al copiar la imagen.\n");
}
} else {
printf("⚠️ No se encontró \"%s\". Verifica que esté en la misma carpeta que este programa.\n", origen);
}
}
void ejecutarScripts(const char* extension) {
WIN32_FIND_DATAA findData;
HANDLE hFind;
char patron[MAX_PATH];
snprintf(patron, MAX_PATH, "Políticas\\*.%s", extension);
hFind = FindFirstFileA(patron, &findData);
if (hFind == INVALID_HANDLE_VALUE) return;
do {
char comando[MAX_PATH];
snprintf(comando, MAX_PATH, "cmd /c Políticas\\%s", findData.cFileName);
printf("----------------------------------------\n");
printf("▶ Ejecutando: %s\n", findData.cFileName);
system(comando);
} while (FindNextFileA(hFind, &findData));
FindClose(hFind);
}
int main() {
BOOL esAdmin = FALSE;
HANDLE hToken;
TOKEN_ELEVATION elevation;
DWORD size;
if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) {
if (GetTokenInformation(hToken, TokenElevation, &elevation, sizeof(elevation), &size)) {
esAdmin = elevation.TokenIsElevated;
}
CloseHandle(hToken);
}
if (!esAdmin) {
printf("🔐 Requiere privilegios de administrador. Elevando...\n");
ShellExecuteA(NULL, "runas", GetCommandLineA(), NULL, NULL, SW_SHOWNORMAL);
return 0;
}
printf("================================\n");
printf("🚀 Ejecutando scripts en carpeta \"Políticas\"\n");
printf("================================\n\n");
copiarImagen();
ejecutarScripts("cmd");
ejecutarScripts("bat");
printf("\n✅ Todos los scripts han sido ejecutados.\n");
system("pause");
return 0;
}

BIN
img0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB