35 lines
868 B
Batchfile
35 lines
868 B
Batchfile
@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
|