@echo off setlocal EnableExtensions set "out=%~1" if "%out%"=="" set "out=%USERPROFILE%\ipconfig-report.txt" echo Collecting network configuration ( echo === ipconfig /all === ipconfig /all echo. echo === getmac /v === getmac /v echo. echo === route print -4 === route print -4 ) > "%out%" if errorlevel 1 ( echo Could not write report. exit /b 1 ) for %%A in ("%out%") do echo Report saved: "%out%" (%%~zA bytes) echo The report can contain MAC and IP addresses. Store it carefully. exit /b 0