Que ejecute todas las políticas
This commit is contained in:
34
ejecutar_politicas.cmd
Normal file
34
ejecutar_politicas.cmd
Normal 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
|
||||
Reference in New Issue
Block a user