CODE: [Copy to clipboard]@echo off echo The computers' IP is: > 123.txt for /L %i in (1,1,254) do if exist \\192.168.1.%i\d\123.exe echo 192.168.1.%i >> 123.txt