@echo off setlocal EnableExtensions set "OUTDIR=%~dp0reports" set "OUT=%OUTDIR%\route-report.txt" if not exist "%OUTDIR%" mkdir "%OUTDIR%" echo Route report > "%OUT%" echo Generated: %DATE% %TIME% >> "%OUT%" echo. >> "%OUT%" route print -4 >> "%OUT%" 2>&1 echo. >> "%OUT%" netstat -rn >> "%OUT%" 2>&1 echo Report saved to "%OUT%" echo Routes were only read, nothing was changed. exit /b 0