```batch
@echo off
@title LAN Online Computer Shared Resource Scan wangwei QQ 251485609
@echo.
@echo Perform ping tests on the LAN, find online computer shared resources, and browse and manage them as if operating on your own computer.
@echo.
@echo Serious warning: Without the other party's consent, illegal access and operation are not allowed, otherwise the responsibility lies with yourself.
@echo.
set /p wgsz= Please enter the gateway (default 192.168.1.1):
@echo.
arp -d 2>nul
if "%wgsz%"=="" set wgsz=192.168.1.1
ping -n 1 %wgsz%>nul
cd.>jc.txt
for /f "tokens=*" %%i in ('arp -a') do @echo %%i>>jc.txt
for /f "tokens=1* delims=:" %%i in ('findstr /n . jc.txt') do if %%i equ 1 @echo %%j>ip.txt
for /f "tokens=2 delims= " %%i in (ip.txt) do set ip=%%i
for /f "tokens=1* delims=:" %%i in ('findstr /n . jc.txt') do if %%i equ 3 @echo %%j>wg.txt
del ip.txt
for /f "tokens=1" %%l in (wg.txt) do set wd1=%%l
@echo The following computers are online in the LAN! (Local IP: %ip%)>zx.txt
@echo IP Address MAC Address>>zx.txt
set wd=%wd1:~0,-1%
set /p dzm= How many ports do you want to scan? (0-255):
cd.>jc.txt
for /l %%i in (0,1,%dzm%) do start ping -n 1 %wd%%%i
for /f "skip=3 tokens=*" %%k in ('arp -a') do @echo %%k >>jc.txt
for /f "tokens=1,2" %%j in ('findstr /c:"dynamic" jc.txt') do @echo %%j>>zx.txt
del jc.txt
del wg.txt
start zx.txt
cls
@echo.
@echo Scanning shared resources, please wait... ...
echo Shared resources found>gxzy.txt
for /f "skip=3 tokens=*" %%k in (zx.txt) do (
for %%f in (c d e f g h) do (
if exist "\\%%k\Local Disk (%%f)\" net view \\%%k|find "Local Disk"&&echo "\\%%k\Local Disk (%%f)\">>gxzy.txt
)
)
del zx.txt
cd.>gxzys.txt
for /f "delims=" %%a in ('findstr /n .* "gxzy.txt"') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
if not "!var!"=="" set var=!var:"=!
echo.!var!>>gxzys.txt
endlocal
)
del gxzy.txt
start gxzys.txt
```
[ Last edited by ZJHJ on 2009-6-3 at 10:16 ]
@echo off
@title LAN Online Computer Shared Resource Scan wangwei QQ 251485609
@echo.
@echo Perform ping tests on the LAN, find online computer shared resources, and browse and manage them as if operating on your own computer.
@echo.
@echo Serious warning: Without the other party's consent, illegal access and operation are not allowed, otherwise the responsibility lies with yourself.
@echo.
set /p wgsz= Please enter the gateway (default 192.168.1.1):
@echo.
arp -d 2>nul
if "%wgsz%"=="" set wgsz=192.168.1.1
ping -n 1 %wgsz%>nul
cd.>jc.txt
for /f "tokens=*" %%i in ('arp -a') do @echo %%i>>jc.txt
for /f "tokens=1* delims=:" %%i in ('findstr /n . jc.txt') do if %%i equ 1 @echo %%j>ip.txt
for /f "tokens=2 delims= " %%i in (ip.txt) do set ip=%%i
for /f "tokens=1* delims=:" %%i in ('findstr /n . jc.txt') do if %%i equ 3 @echo %%j>wg.txt
del ip.txt
for /f "tokens=1" %%l in (wg.txt) do set wd1=%%l
@echo The following computers are online in the LAN! (Local IP: %ip%)>zx.txt
@echo IP Address MAC Address>>zx.txt
set wd=%wd1:~0,-1%
set /p dzm= How many ports do you want to scan? (0-255):
cd.>jc.txt
for /l %%i in (0,1,%dzm%) do start ping -n 1 %wd%%%i
for /f "skip=3 tokens=*" %%k in ('arp -a') do @echo %%k >>jc.txt
for /f "tokens=1,2" %%j in ('findstr /c:"dynamic" jc.txt') do @echo %%j>>zx.txt
del jc.txt
del wg.txt
start zx.txt
cls
@echo.
@echo Scanning shared resources, please wait... ...
echo Shared resources found>gxzy.txt
for /f "skip=3 tokens=*" %%k in (zx.txt) do (
for %%f in (c d e f g h) do (
if exist "\\%%k\Local Disk (%%f)\" net view \\%%k|find "Local Disk"&&echo "\\%%k\Local Disk (%%f)\">>gxzy.txt
)
)
del zx.txt
cd.>gxzys.txt
for /f "delims=" %%a in ('findstr /n .* "gxzy.txt"') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
if not "!var!"=="" set var=!var:"=!
echo.!var!>>gxzys.txt
endlocal
)
del gxzy.txt
start gxzys.txt
```
[ Last edited by ZJHJ on 2009-6-3 at 10:16 ]
