Que ejecute todas las políticas

This commit is contained in:
2025-05-27 22:06:42 +00:00
parent e096eabec3
commit 86d6abf4e3

34
ejecutar_politicas.cmd Normal file
View File

@@ -0,0 +1,34 @@
@echo off
setlocal enableextensions enabledelayedexpansion
:: ============================
:: Verifica privilegios de administrador
:: ============================
net session >nul 2>&1
if %errorLevel% neq 0 (
echo 🔐 Requiere privilegios de administrador. Elevando...
powershell -Command "Start-Process '%~f0' -Verb runAs"
exit /b
)
echo ================================
echo 🚀 Ejecutando scripts en carpeta "Políticas"
echo ================================
set "CARPETA=Políticas"
if not exist "%CARPETA%" (
echo ❌ La carpeta "%CARPETA%" no existe.
pause
exit /b
)
:: Itera y ejecuta todos los .cmd y .bat en la carpeta
for %%F in ("%CARPETA%\*.cmd" "%CARPETA%\*.bat") do (
echo ----------------------------------------
echo ▶ Ejecutando: %%~nxF
call "%%F"
)
echo ✅ Todos los scripts han sido ejecutados.
pause