@echo off setlocal EnableExtensions set "OUTDIR=%~dp0reports" set "OUT=%OUTDIR%\ip-report.txt" if not exist "%OUTDIR%" mkdir "%OUTDIR%" echo IP configuration report > "%OUT%" echo Generated: %DATE% %TIME% >> "%OUT%" echo. >> "%OUT%" ipconfig /all >> "%OUT%" 2>&1 echo. >> "%OUT%" getmac /v >> "%OUT%" 2>&1 echo Report saved to "%OUT%" echo Network settings were only read, nothing was changed. exit /b 0