I wrote a shared-file scanner for the local network myself, but the problem comes up at the very last step. Please give me some pointers, experts!
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%i in ('ipconfig^|find /i "IP Address"') do set ip=%%j
echo %ip:~1,10%
for /l %%a in ( 99,1,99 ) do ( ping %ip:~1,10%%%a -n 1 -w 10|find "TTL"&&for /f "skip=7" %%c in ('net view %ip:~1,10%%%a') do ( for /r "\\%ip:~1,10%%%a\%%c" %%k in (*.rar) do echo %%k ) )
pause
Explanation: this was tested on my own machine. My local IP is 192.168.1.99. Actually, if you want to scan the local network, you only need to change for /l %%a in ( 99,1,99 ) here. But the current problem is that the command for /r "\\%ip:~1,10%%%a\%%c" %%k in (*.rar) do echo %%k ) is not executing properly. I’d appreciate some pointers from an expert! Many thanks! Waiting online!
@echo off&setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%i in ('ipconfig^|find /i "IP Address"') do set ip=%%j
echo %ip:~1,10%
for /l %%a in ( 99,1,99 ) do ( ping %ip:~1,10%%%a -n 1 -w 10|find "TTL"&&for /f "skip=7" %%c in ('net view %ip:~1,10%%%a') do ( for /r "\\%ip:~1,10%%%a\%%c" %%k in (*.rar) do echo %%k ) )
pause
Explanation: this was tested on my own machine. My local IP is 192.168.1.99. Actually, if you want to scan the local network, you only need to change for /l %%a in ( 99,1,99 ) here. But the current problem is that the command for /r "\\%ip:~1,10%%%a\%%c" %%k in (*.rar) do echo %%k ) is not executing properly. I’d appreciate some pointers from an expert! Many thanks! Waiting online!
