China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 11:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] A shared-file scanner for the local network that I wrote myself! View 748 Replies 0
Original Poster Posted 2008-08-07 20:06 ·  中国 广东 深圳 南山区 电信
初级用户
Credits 30
Posts 18
Joined 2008-05-11 01:43
18-year member
UID 118377
Gender Male
Status Offline
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!
Forum Jump: