Vam decidir fer dos scripts per sistema operatiu.

Windows:

Primer script

@echo off
:: Comprobar si hay permisos de administrador
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo Por favor, ejecuta este archivo como ADMINISTRADOR.
    pause
    exit
)

echo --- 1. INSTALANDO PROGRAMAS ESENCIALES ---
:: Usamos winget directamente
winget install --id Google.Chrome -e --silent
winget install --id VideoLAN.VLC -e --silent
winget install --id 7zip.7zip -e --silent

echo --- 2. OPTIMIZANDO EXPLORADOR ---
:: Mostrar extensiones y archivos ocultos
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Hidden" /t REG_DWORD /d 1 /f

echo --- 3. ELIMINANDO PUBLICIDAD DEL MENÚ INICIO ---
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f

echo --- 4. LIMPIEZA DE DISCO RÁPIDA ---
del /s /f /q %temp%\.

echo Proceso terminado.
pause

Aquest script es com un petit setup/optimizador automatitzat del sistema operatiu Windows que ens permet instal·lar 3 programes esencials, fer una petita optimització de l’explorador i menu de Windows i netejar els arxius temporals automàticament.

Segon script:

# Reporte rápido del estado del equipo
# Guarda un reporte en el escritorio o en una carpeta compartida

$fecha = Get-Date -Format "yyyy-MM-dd_HH-mm"
$reportePath = "$env:USERPROFILE\Desktop\Reporte_Sistema_$fecha.txt"
# $reportePath = "\\servidor\reportes\$env:COMPUTERNAME`_Reporte_$fecha.txt"   # descomenta si usas red

Write-Host "Generando reporte del sistema... ($fecha)" -ForegroundColor Cyan

"======================================" | Out-File $reportePath -Encoding utf8
"REPORTE DEL SISTEMA - $env:COMPUTERNAME" | Out-File $reportePath -Append -Encoding utf8
"Fecha: $fecha" | Out-File $reportePath -Append -Encoding utf8
"Usuario: $env:USERNAME" | Out-File $reportePath -Append -Encoding utf8
"======================================" | Out-File $reportePath -Append -Encoding utf8

# 1. Información básica
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsBuildNumber, CsManufacturer, CsModel |
    Format-List | Out-String | Out-File $reportePath -Append -Encoding utf8

# 2. Uso de discos (C: y otros)
Get-PSDrive -PSProvider FileSystem | Where-Object Used -gt 0 |
    Select-Object Name, @{Name="UsadoGB";Expression={[math]::Round($_.Used/1GB,2)}}, 
    @{Name="LibreGB";Expression={[math]::Round($_.Free/1GB,2)}}, 
    @{Name="TotalGB";Expression={[math]::Round($_.Used/1GB + $_.Free/1GB,2)}},
    @{Name="%Libre";Expression={[math]::Round(($_.Free/($_.Used + $_.Free))*100,1)}} |
    Format-Table -AutoSize | Out-String | Out-File $reportePath -Append -Encoding utf8

# 3. Memoria y CPU
$mem = Get-CimInstance Win32_OperatingSystem
"Memoria Total: $([math]::Round($mem.TotalVisibleMemorySize/1MB,1)) GB" | Out-File $reportePath -Append -Encoding utf8
"Memoria Libre: $([math]::Round($mem.FreePhysicalMemory/1MB,1)) GB" | Out-File $reportePath -Append -Encoding utf8

$cpu = Get-Counter '\Processor(_Total)\% Processor Time'
"Uso CPU actual: $($cpu.CounterSamples.CookedValue.ToString('N1')) %" | Out-File $reportePath -Append -Encoding utf8

# 4. Actualizaciones pendientes (requiere módulo PSWindowsUpdate o solo Windows Update)
"Actualizaciones pendientes:" | Out-File $reportePath -Append -Encoding utf8
try {
    Get-WUList | Select-Object Title, Size, Categories | Format-Table -AutoSize | Out-String | Out-File $reportePath -Append -Encoding utf8
} catch {
    "  (Instala módulo PSWindowsUpdate para ver lista detallada)" | Out-File $reportePath -Append -Encoding utf8
}

# 5. Servicios parados importantes (puedes personalizar la lista)
$serviciosCriticos = @("wuauserv", "WinDefend", "Spooler", "LanmanServer")
"Servicios críticos parados:" | Out-File $reportePath -Append -Encoding utf8
Get-Service -Name $serviciosCriticos | Where-Object Status -eq "Stopped" |
    Select-Object Name, Status, StartType | Format-Table -AutoSize | Out-String | Out-File $reportePath -Append -Encoding utf8

Write-Host "`nReporte generado en: $reportePath" -ForegroundColor Green
Write-Host "Puedes programarlo diariamente en el Programador de tareas" -ForegroundColor DarkGray

Aquest script ens fa un diagnòstic del nostre ordinador on podem veure el seu estat, l’us dels components i fins i tot els serveis importants que estàn parats.

Linux:

Primer script:

#!/bin/bash

# Colores para la salida
GREEN='\033[0;32m'
NC='\033[0m' # Sin color

echo -e "${GREEN}>>> Iniciando actualización del sistema...${NC}"
sudo apt update && sudo apt upgrade -y

echo -e "${GREEN}>>> Instalando herramientas esenciales...${NC}"
sudo apt install -y curl wget git build-essential ufw vim

echo -e "${GREEN}>>> Configurando Firewall (SSH, HTTP, HTTPS)...${NC}"
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable

echo -e "${GREEN}>>> Limpiando paquetes innecesarios...${NC}"
sudo apt autoremove -y

echo -e "${GREEN}✅ Sistema base configurado con éxito.${NC}"

Aquest script fa un setup del sistema operatiu però en compte de Windows a Linux. La seva funció es fer una actualització del sistema, instala algunes eines esencials, configura el firewall i neteja paquets innecessaris.

Segon script:

echo "--- Iniciando limpieza de mantenimiento ---"

# 1. Borrar archivos en 'Descargas' con más de 30 días de antigüedad
echo "> Eliminando archivos antiguos en Descargas..."
find ~/Downloads -type f -mtime +30 -exec rm {} \;

# 2. Vaciar la papelera de reciclaje (Linux/Ubuntu)
echo "> Vaciando la papelera..."
rm -rf ~/.local/share/Trash/*

# 3. Buscar y truncar archivos .log de más de 100MB en un directorio específico
# (En lugar de borrarlos, los deja en 0 bytes para no romper procesos)
LOG_DIR="./logs"
if [ -d "$LOG_DIR" ]; then
    echo "> Optimizando archivos de log pesados..."
    find "$LOG_DIR" -name "*.log" -size +100M -exec truncate -s 0 {} \;
fi

echo "✅ Limpieza finalizada."

Aquest script s’encarrega d’optimitzar el sistema netejant arxius que ja no utilitzem o que no son necessaris.

Aquests scripts han sigut generats amb IA, va ser bastant fàcil que donès els codis que li demanaven. Per exemple als de Linux va ser un al primer intent i un altre al segon intent, pels scripts de Windows li va costar una mica més sobretot pel tema dels permisos d’administrador però finalment especificant-li les coses be.