Files
policies/ejecutar_politicas.cmd
2025-05-27 22:14:46 +00:00

54 lines
1.4 KiB
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 ================================
:: ============================
:: Copiar imagen institucional a C:\Shared
:: ============================
set "ORIGEN_IMG=img0.jpg"
set "DESTINO_IMG=C:\Shared\img0.jpg"
if exist "%ORIGEN_IMG%" (
echo 🖼️ Copiando imagen institucional a %DESTINO_IMG%...
if not exist "C:\Shared" (
mkdir "C:\Shared"
)
copy /Y "%ORIGEN_IMG%" "%DESTINO_IMG%" >nul
echo ✅ Imagen copiada correctamente.
) else (
echo ⚠️ No se encontró "%ORIGEN_IMG%". Verifica que esté en la misma carpeta que este script.
)
:: ============================
:: Ejecutar scripts .cmd y .bat en /Políticas
:: ============================
set "CARPETA=Políticas"
if not exist "%CARPETA%" (
echo ❌ La carpeta "%CARPETA%" no existe.
pause
exit /b
)
for %%F in ("%CARPETA%\*.cmd" "%CARPETA%\*.bat") do (
echo ----------------------------------------
echo ▶ Ejecutando: %%~nxF
call "%%F"
)
echo ✅ Todos los scripts han sido ejecutados.
pause