From 86d6abf4e3fe5f6800d18bfbb514e546c1ede61f Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Tue, 27 May 2025 22:06:42 +0000 Subject: [PATCH] =?UTF-8?q?Que=20ejecute=20todas=20las=20pol=C3=ADticas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ejecutar_politicas.cmd | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ejecutar_politicas.cmd diff --git a/ejecutar_politicas.cmd b/ejecutar_politicas.cmd new file mode 100644 index 0000000..a3dc00d --- /dev/null +++ b/ejecutar_politicas.cmd @@ -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