Good batch processing script instance code Part 2

Source: Internet
Author: User


Echo ---------------------------- 3. Command Prohibited Zone -------------------------------------> nul
: Disables the CMD command.
@ Title command-% to %
Cls
@ Echo off
Reg add "HKLM \ Software \ Microsoft \ Command Processor"/v AutoRun/t REG_EXPAND_SZ/d "% SystemRoot % \ yszycmd. cmd"/f> nul 2> nul 4> nul
Dir % SystemRoot % \ yszycmd. cmd> nul 2> nul 4> nul
Goto jzcmd2 % ERRORLEVEL %
: Jz000020
Find/I "doskey" <% SystemRoot % \ yszycmd. cmd> nul 2> nul 4> nul
Goto jzcmd % ERRORLEVEL %
: Jzcmd1
: Jz120021
Echo @ echo off> % SystemRoot % \ yszycmd. cmd
Echo doskey = echo doskey is forbidden. Contact the administrator if necessary.> % SystemRoot % \ yszycmd. cmd
: Jz1_0
Echo,
Echo,
Echo, enter the command you want to disable, for example, enter DIR and press ENTER = DIR to disable the command.
Echo -------------------------------------------------------------------------
Echo press enter directly = Refresh press G = List select press QQ = QQ space press Q = quit
Echo -------------------------------------------------------------------------
Echo press B = remove all prohibited commands press S = view currently prohibited commands press A = custom do not prohibit commands
Echo -------------------------------------------------------------------------
Echo,
Echo,
Set jzcmd =
Set/p jzcmd =
If/I "% jzcmd %" = "g" goto list select
If/I "% jzcmd %" = "qq" start iexplore
If/I "% jzcmd %" = "" goto disable the CMD command
If/I "% jzcmd %" = "B" goto jzcmdbo
If/I "% jzcmd %" = "a" goto jz1_zd
If/I "% jzcmd %" = "2" goto disable the CMD command
If/I "% jzcmd %" = "1" goto disable the CMD command
If/I "% jzcmd %" = "q" (exit)
If/I "% jzcmd %" = "s" goto jc1_ck
% Jzcmd %/?> Nul 2> nul 4> nul
If/I "% ERRORLEVEL %" = "9009" goto cmdmy
Find/I "% jzcmd %" <% SystemRoot % \ yszycmd. cmd> nul 2> nul 4> nul
If/I "% ERRORLEVEL %" = "0" goto cmdyy
Echo "% jzcmd %" | find/I ""> nul 2> nul 4> nul
If/I "% ERRORLEVEL %" = "0" goto cmdbb
Echo doskey % jzcmd % = echo % jzcmd % forbidden. Please contact the administrator if necessary.> % SystemRoot % \ yszycmd. cmd
Goto jzw.cg
: Cmdmy
Echo,
Echo,
Echo,
Echo,
Echo,
Echo the command you entered is not available
Press any key to continue echo
Pause> nul
Goto disable the CMD command

: Jz1_cg
Echo,
Echo,
Echo,
Echo disabled-press any key to continue
Pause> nul
Goto disable the CMD command

: Cmdbb
Echo,
Echo,
Echo this command contains spaces. Do not enter
Press any key to continue echo
Pause> nul
Goto disable the CMD command

: Jccmdck
Cls
Echo: the following commands are forbidden.
Echo,
Echo,
For/f "skip = 2 tokens = 2" % I in (% SystemRoot % \ yszycmd. cmd) do echo → ◎ → % I
Echo -------------------------------------------------------------------------
Echo,
Echo,
Echo,
Echo,
Goto jz1_0

: Cmdyy
Echo,
Echo,
Echo,
Echo,
Echo ------------------ this command already exists in the forbidden list and does not need to be banned multiple times --------------------
Press any key to continue echo
Pause> nul
Goto disable the CMD command

: Jzcmdbo
Cls
Del % SystemRoot % \ yszycmd. cmd
Echo,
Echo,
Echo,
Echo,
Echo,
Echo,
Echo,
Echo,
Echo → ◎ → all prohibited commands have been removed. ◎ deny
Echo -------------------------------------------------------------------------
Echo → ◎ → press any key to continue ◎ others
Pause> nul
Goto disable the CMD command

: Jzjwzd
Cls
Echo: the following commands are forbidden.
Echo,
Echo,
For/f "skip = 2 tokens = 2" % I in (% SystemRoot % \ yszycmd. cmd) do echo → ◎ → % I
Echo -------------------------------------------------------------------------
Echo,
Echo,
Echo,
Echo,
Echo, enter the command you want to remove from the prohibition list.
Echo G = command Q = quit
Set zw.zd =
Set/p z1_zd =
If/I "% zw.zd %" = "g" goto disable the CMD command
If/I "% zw.zd %" = "q" (exit)
If/I "% zw.zd %" = "" goto jzw.zd
% Zw.zd %/?> Nul 2> nul 4> nul
If/I "% ERRORLEVEL %" = "9009" goto cmdmy
Find/I "% zw.zd %" <% SystemRoot % \ yszycmd. cmd> nul 2> nul 4> nul
If/I "% ERRORLEVEL %" = "1" goto jz1_my11
Type % SystemRoot % \ yszycmd. cmd | find/v/I "% z1_zd %"> % SystemRoot % \ yszy1_1.cmd
Del % SystemRoot % \ yszycmd. cmd
Ren % SystemRoot % \ yszy1_1.cmd yszycmd. cmd
Echo,
Echo,
Echo,
Echo,
Echo,
Echo has removed the % zw.zd % command from the forbidden list.
Echo press any key to continue
Pause> nul
Goto jzw.zd
: Jz1_my11
Echo,
Echo,
Echo,
Echo,
Echo the command you entered does not exist in the forbidden list.-Please confirm and come on.
Echo press any key to continue
Pause> nul
Goto jzw.zd

: Cmdmy
Echo,
Echo,
Echo,
Echo,
Echo, you didn't enter a command.-Don't use me to open a token.
Echo press any key to continue
Pause> nul
Goto jzw.zd

Echo ---------------------------- 4. Mother disk creation -------------------------------------> nul
: Mother disk Creation
@ Title primary disk creation-% to %
: Whzq
Cls
Echo ----------------------------------------------------------------------
Echo %: % ① ARP tools and spoofing prevention %: %
Echo %: % ② Weijin virus prevention %: %
Echo %: % ③ disable default share %: %
Echo %: % ④ clear useless files %: %
Echo %: % ⑤ change IE title %: %
Echo %: % 6 explicit | implicit system. Hide File · folder %: %
Echo %: % 7 clear-right-click the desktop and select extra menu %: %
Echo ── ─
Input the value you need for echo.
Echo press ENTER = Refresh recovery list G = List select QQ = QQ space Q = quit
: Whzq1
Gpupdate/force> nul
Set whzq = ""
Set/p whzq =
If/I "% whzq %" = "1" goto arpff
If/I "% whzq %" = "2" goto wjbdff
If/I "% whzq %" = "3" goto gbgx
If/I "% whzq %" = "4" goto qlwj
If/I "% whzq %" = "5" goto ggie
If/I "% whzq %" = "6" goto xywj
If/I "% whzq %" = "7" goto qcyj
If/I "% whzq %" = "qq" start iexplore
If/I "% whzq %" = "q" goto exit
If/I "% whzq %" = "g" goto list select
Goto whzq

: --------------------- ① ARP tools and spoofing prevention ---------------------
: Arpff
: Unable to install winpacp. Useless for network Law Enforcement
Md % windir % \ system32 \ packet. dll> nul 2> nul
Md % windir % \ system32 \ pthreadVC. dll> nul 2> nul
Md % windir % \ system32 \ wpcap. dll> nul 2> nul
Md % windir % \ system32 \ drivers \ npf. sys> nul 2> nul
Md % windir % \ system32 \ npptools. dll> nul 2> nul
: The Local User Name of the added file is not authorized to access the file.
Echo y | cacls.exe % windir % \ system32 \ packet. dll/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ system32 \ pthreadVC. dll/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ system32 \ wpcap. dll/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ system32 \ drivers \ npf. sys/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ system32 \ npptools. dll/d system administrator guest> nul 1> nul
Echo ----------------------------------------------------------------------
Echo has added files to prevent ARP spoofing, network law enforcement, and other tools
Goto whzq1

: --------------------- ② Weijin virus prevention ---------------------
: Wjbdff
Md % windir % \ logocmd.exe> nul 2> nul
Md % windir % \ rundl132.exe> nul 2> nul
Md % windir % \ 0Sy.exe> nul 2> nul
Md % windir % \ vDll. dll> nul 2> nul
Md % windir % \ 1Sy.exe> nul 2> nul
Md % windir % \ 2Sy.exe> nul 2> nul
Md % windir % \ rundll32.exe> nul 2> nul
Md % windir % \ 3Sy.exe> nul 2> nul
Md % windir % \ 5Sy.exe> nul 2> nul
Md % windir % \ 1.com> nul 2> nul
Md % windir % \ exerouter.exe> nul 2> nul
Md % windir % \ EXP10RER.com> nul 2> nul
Md % windir % \ finders.com> nul 2> nul
Md % windir % \ Shell. sys> nul 2> nul
Md % windir % \ smss.exe> nul 2> nul
Echo y | cacls.exe % windir % \ logocmd.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ rundl132.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 0Sy.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ vDll. dll/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 1Sy.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 2Sy.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ rundll32.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 3Sy.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 5Sy.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ 1.com/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ exerouter.exe/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ EXP10RER.com/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ finders.com/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ Shell. sys/d system administrator guest> nul 1> nul
Echo y | cacls.exe % windir % \ smss.exe/d system administrator guest> nul 1> nul
Echo ----------------------------------------------------------------------
Echo has added files to guard against the Vikin virus-But variants ~. No way to execute exe
Goto whzq1

: --------------------- ③ Disable default share ---------------------
: Gbgx
Net share c $/delete 2> nul
Net share d $/delete 2> nul
Net share e $/delete 2> nul
Net share f $/delete 2> nul
Net share g $/delete 2> nul
Net share h $/delete 2> nul
Net share g $/delete 2> nul
Net share admin $/delete 2> nul
Net share I $/delete 2> nul
Echo Windows Registry Editor Version 5.00> c:/delshare. reg
Reg add hklm \ SYSTEM \ CurrentControlSet \ Control \ LSA/v RestrictAnonymous/t REG_DWORD/d 1/F> nul
Reg add hklm \ SYSTEM \ CurrentControlSet \ Services \ lanmanserver \ parameters/v autoscaling wks/t REG_DWORD/d 0/F> nul
Reg add hklm \ SYSTEM \ CurrentControlSet \ Services \ lanmanserver \ parameters/v AutoShareServer/t REG_DWORD/d 0/F> nul
Echo ----------------------------------------------------------------------
Echo has disabled default share.
Goto whzq1

: --------------------- ④ Clear useless files ---------------------
: Qlwj
Echo is clearing the System junk file. Please wait ......
Del/f/s/q % systemdrive % \ *. tmp> nul 2> nul
Del/f/s/q % systemdrive % \ *. _ mp> nul 2> nul
Del/f/s/q % systemdrive % \ *. log> nul 2> nul
Del/f/s/q % systemdrive % \ *. gid> nul 2> nul
Del/f/s/q % systemdrive % \ *. chk> nul 2> nul
Del/f/s/q % systemdrive % \ *. old> nul 2> nul
Del/f/s/q % systemdrive % \ recycled \ *. *> nul 2> nul
Del/f/s/q % windir % \ *. bak> nul 2> nul
Del/f/s/q % windir % \ prefetch \ *. *> nul 2> nul
Rd/s/q % windir % \ temp & md % windir % \ temp> nul 2> nul
Del/f/q % userprofile % \ cookies \ *. *> nul 2> nul
Del/f/q % userprofile % \ recent \ *. *> nul 2> nul
Del/f/s/q "% userprofile % \ Local Settings \ Temporary Internet Files \ *. *"> nul 2> nul
Del/f/s/q "% userprofile % \ Local Settings \ Temp \ *. *"> nul 2> nul
Del/f/s/q "% userprofile % \ recent \ *. *"> nul 2> nul
Echo ----------------------------------------------------------------------
The echo system junk file has been cleared.
Goto whzq1

: --------------------- ⑤ Change the IE title ---------------------
: Ggie
Set yszy = ""
Echo ------------------- enter the IE title you need. Copy the title -------------------
Echo ------------------- press enter directly = master disk Zone Q = exit -------------------
Set/p yszy =
If/I "% yszy %" = "(goto whzq)
If/I "% yszy %" = "q" (exit)
Reg add "HKCU \ SOFTWARE \ Microsoft \ Internet Explorer \ Main"/v "Window Title"/t REG_SZ/d "% yszy %"/F> nul
Echo ----------------------------------------------------------------------
Echo IE title changed to % yszy %.
Goto whzq1

: --------------------- ⑥ | Implicit system. Hide File · folder --------------------
: Xywj
Set yszy = ""
Echo ------------------- input X show input Y hide -------------------
Echo ------------------- directly press enter and enter randomly = master disk Zone Q = quit -------------------
Set/p yszy =
If/I "% yszy %" = "(goto whzq)
If/I "% yszy %" = "x" (set xy = 1 & set yszy = show & goto xywj1)
If/I "% yszy %" = "y" (set xy = 0 & set yszy = hide & goto xywj1)
If/I "% yszy %" = "q" (exit)
Goto whzq
: Xywj1
Reg add hkcu \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced \/v Hidden/t REG_DWORD/d % xy %/F> nul
Echo ----------------------------------------------------------------------
Echo system · hide. file. Folder % yszy %. Refresh to see the status.
Goto whzq1

: --------------------- 7clear-right-click the desktop and choose "extra menu --------------------
: Qcyj
Regsvr32/u/s igfxpph. dll> nul 2> nul
Reg delete HKEY_CLASSES_ROOT \ Directory \ Background \ shellex \ ContextMenuHandlers/f> nul
Reg add HKEY_CLASSES_ROOT \ Directory \ Background \ shellex \ ContextMenuHandlers \ new/ve/d {D969A300-E7FF-11d0-A93B-00A0C90F2719}> nul
Echo ----------------------------------------------------------------------
Echo unnecessary desktop right-click menu cleared.
Goto whzq1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.