不错的批处理脚本实例代码 第二部分
不错的批处理脚本实例代码 第二部分
发布时间:2016-12-28 来源:查字典编辑
摘要:echo----------------------------3.命令禁止专区------------------------------...

echo----------------------------3.命令禁止专区----------------------------------->nul

:禁止CMD命令

@title命令禁止-%以%

cls

@echooff

regadd"HKLMSoftwareMicrosoftCommandProcessor"/vAutoRun/tREG_EXPAND_SZ/d"%SystemRoot%yszycmd.cmd"/f>nul2>nul4>nul

dir%SystemRoot%yszycmd.cmd>nul2>nul4>nul

gotojzcmd2%ERRORLEVEL%

:jzcmd20

find/i"doskey"<%SystemRoot%yszycmd.cmd>nul2>nul4>nul

gotojzcmd%ERRORLEVEL%

:jzcmd1

:jzcmd21

echo@echooff>%SystemRoot%yszycmd.cmd

echodoskeydoskey=echodoskey已经禁止如有需要请联系管理员.>>%SystemRoot%yszycmd.cmd

:jzcmd0

echo,

echo,

echo请输入你要禁止的命令如:输入DIR然后回车=DIR命令禁止使用

echo-------------------------------------------------------------------------

echo直接回车=刷新按G=列表选择按QQ=俺QQ空间按Q=退出

echo-------------------------------------------------------------------------

echo按B=去除所有禁止命令按S=查看当前禁止的命令按A=自定义不要禁止的命令

echo-------------------------------------------------------------------------

echo,

echo,

setjzcmd=

set/pjzcmd=

if/I"%jzcmd%"=="g"goto列表选择

if/I"%jzcmd%"=="qq"startiexplore

if/I"%jzcmd%"==""goto禁止CMD命令

if/I"%jzcmd%"=="b"gotojzcmdbo

if/I"%jzcmd%"=="a"gotojzcmdzd

if/I"%jzcmd%"=="2"goto禁止CMD命令

if/I"%jzcmd%"=="1"goto禁止CMD命令

if/I"%jzcmd%"=="q"(exit)

if/I"%jzcmd%"=="s"gotojccmdck

%jzcmd%/?>nul2>nul4>nul

if/I"%ERRORLEVEL%"=="9009"gotocmdmy

find/i"%jzcmd%"<%SystemRoot%yszycmd.cmd>nul2>nul4>nul

if/I"%ERRORLEVEL%"=="0"gotocmdyy

echo"%jzcmd%"|find/i"">nul2>nul4>nul

if/I"%ERRORLEVEL%"=="0"gotocmdbb

echodoskey%jzcmd%=echo%jzcmd%已经禁止如有需要请联系管理员.>>%SystemRoot%yszycmd.cmd

gotojzcmdcg

:cmdmy

echo,

echo,

echo,

echo,

echo,

echo你输入的命令不可用

echo请按任意键继续

pause>nul

goto禁止CMD命令

:jzcmdcg

echo,

echo,

echo,

echo已经禁止-请按任意键继续

pause>nul

goto禁止CMD命令

:cmdbb

echo,

echo,

echo此命令带空格.不可输入

echo请按任意键继续

pause>nul

goto禁止CMD命令

:jccmdck

cls

echo以下是已经禁止的命令

echo,

echo,

for/f"skip=2tokens=2"%%iin(%SystemRoot%yszycmd.cmd)doecho→◎→◎→◎→◎→◎→%%i

echo-------------------------------------------------------------------------

echo,

echo,

echo,

echo,

gotojzcmd0

:cmdyy

echo,

echo,

echo,

echo,

echo------------------此命令已经存在禁止列表中,不需多次禁止--------------------

echo请按任意键继续

pause>nul

goto禁止CMD命令

:jzcmdbo

cls

del%SystemRoot%yszycmd.cmd

echo,

echo,

echo,

echo,

echo,

echo,

echo,

echo,

echo→◎→◎→◎→◎→◎→已经去除所有禁止命令←◎←◎←◎←◎←◎←

echo-------------------------------------------------------------------------

echo→◎→◎→◎→◎→◎→请按任意键继续←◎←◎←◎←◎←◎←

pause>nul

goto禁止CMD命令

:jzcmdzd

cls

echo以下是已经禁止的命令

echo,

echo,

for/f"skip=2tokens=2"%%iin(%SystemRoot%yszycmd.cmd)doecho→◎→◎→◎→◎→◎→%%i

echo-------------------------------------------------------------------------

echo,

echo,

echo,

echo,

echo请输入你要从禁止列表中去除的命令

echoG=返回禁止CMD命令Q=退出

setzcmdzd=

set/pzcmdzd=

if/I"%zcmdzd%"=="g"goto禁止CMD命令

if/I"%zcmdzd%"=="q"(exit)

if/I"%zcmdzd%"==""gotojzcmdzd

%zcmdzd%/?>nul2>nul4>nul

if/I"%ERRORLEVEL%"=="9009"gotocmdmy

find/i"%zcmdzd%"<%SystemRoot%yszycmd.cmd>nul2>nul4>nul

if/I"%ERRORLEVEL%"=="1"gotojzcmdmy11

type%SystemRoot%yszycmd.cmd|find/v/i"%zcmdzd%">%SystemRoot%yszycmd1.cmd

del%SystemRoot%yszycmd.cmd

ren%SystemRoot%yszycmd1.cmdyszycmd.cmd

echo,

echo,

echo,

echo,

echo,

echo已经从禁止列表中去除%zcmdzd%命令

echo按任意键继续

pause>nul

gotojzcmdzd

:jzcmdmy11

echo,

echo,

echo,

echo,

echo你输入的命令不存在禁止列表中-请确定后在来吧

echo按任意键继续

pause>nul

gotojzcmdzd

:cmdmy

echo,

echo,

echo,

echo,

echo你输入的不是命令-不要拿我来开唰哦

echo按任意键继续

pause>nul

gotojzcmdzd

echo----------------------------4.母盘制作----------------------------------->nul

:母盘制作

@title母盘制作-%以%

:whzq

cls

echo----------------------------------------------------------------------

echo%:%①ARP工具与欺骗防范%:%

echo%:%②威金病毒防范%:%

echo%:%③关闭默认共享%:%

echo%:%④清理无用文件%:%

echo%:%⑤更改IE标题%:%

echo%:%⑥显|隐系统.隐藏文件·夹%:%

echo%:%⑦清除-桌面右键多余菜单%:%

echo───────────────────────────────────

echo请输入你需要的对应值.

echo按回车=刷新恢复列表G=列表选择QQ=俺QQ空间Q=退出

:whzq1

gpupdate/force>nul

setwhzq=""

set/pwhzq=

if/i"%whzq%"=="1"gotoarpff

if/i"%whzq%"=="2"gotowjbdff

if/i"%whzq%"=="3"gotogbgx

if/i"%whzq%"=="4"gotoqlwj

if/i"%whzq%"=="5"gotoggie

if/i"%whzq%"=="6"gotoxywj

if/i"%whzq%"=="7"gotoqcyj

if/i"%whzq%"=="qq"startiexplore

if/i"%whzq%"=="q"gotoexit

if/i"%whzq%"=="g"goto列表选择

gotowhzq

::---------------------①ARP工具与欺骗防范---------------------

:arpff

::使winpacp装不上.让网络执法管等没用

md%windir%system32packet.dll>nul2>nul

md%windir%system32pthreadVC.dll>nul2>nul

md%windir%system32wpcap.dll>nul2>nul

md%windir%system32driversnpf.sys>nul2>nul

md%windir%system32npptools.dll>nul2>nul

::使以上添加的文件本地用户名没权限访问

echoy|cacls.exe%windir%system32packet.dll/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%system32pthreadVC.dll/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%system32wpcap.dll/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%system32driversnpf.sys/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%system32npptools.dll/dsystemadministratorguest>nul1>nul

echo----------------------------------------------------------------------

echo已经添加防范ARP欺骗与网络执法管等工具的文件

gotowhzq1

::---------------------②威金病毒防范---------------------

:wjbdff

md%windir%Logo1_.exe>nul2>nul

md%windir%rundl132.exe>nul2>nul

md%windir%Sy.exe>nul2>nul

md%windir%vDll.dll>nul2>nul

md%windir%1Sy.exe>nul2>nul

md%windir%2Sy.exe>nul2>nul

md%windir%rundll32.exe>nul2>nul

md%windir%3Sy.exe>nul2>nul

md%windir%5Sy.exe>nul2>nul

md%windir%1.com>nul2>nul

md%windir%exerouter.exe>nul2>nul

md%windir%EXP10RER.com>nul2>nul

md%windir%finders.com>nul2>nul

md%windir%Shell.sys>nul2>nul

md%windir%smss.exe>nul2>nul

echoy|cacls.exe%windir%Logo1_.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%rundl132.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%Sy.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%vDll.dll/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%1Sy.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%2Sy.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%rundll32.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%3Sy.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%5Sy.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%1.com/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%exerouter.exe/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%EXP10RER.com/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%finders.com/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%Shell.sys/dsystemadministratorguest>nul1>nul

echoy|cacls.exe%windir%smss.exe/dsystemadministratorguest>nul1>nul

echo----------------------------------------------------------------------

echo已经添加防范威金病毒的文件-但是变种~.exe尚是没办法

gotowhzq1

::---------------------③关闭默认共享---------------------

:gbgx

netsharec$/delete2>nul

netshared$/delete2>nul

netsharee$/delete2>nul

netsharef$/delete2>nul

netshareg$/delete2>nul

netshareh$/delete2>nul

netshareg$/delete2>nul

netshareadmin$/delete2>nul

netsharei$/delete2>nul

echoWindowsRegistryEditorVersion5.00>c:/delshare.reg

REGADDHKLMSYSTEMCurrentControlSetControlLSA/vRestrictAnonymous/tREG_DWORD/d1/F>nul

REGADDHKLMSYSTEMCurrentControlSetServiceslanmanserverparameters/vAutoShareWks/tREG_DWORD/d0/F>nul

REGADDHKLMSYSTEMCurrentControlSetServiceslanmanserverparameters/vAutoShareServer/tREG_DWORD/d0/F>nul

echo----------------------------------------------------------------------

echo已经关闭默认共享.

gotowhzq1

::---------------------④清理无用文件---------------------

:qlwj

echo正在清除系统垃圾文件,请稍等......

del/f/s/q%systemdrive%*.tmp>nul2>nul

del/f/s/q%systemdrive%*._mp>nul2>nul

del/f/s/q%systemdrive%*.log>nul2>nul

del/f/s/q%systemdrive%*.gid>nul2>nul

del/f/s/q%systemdrive%*.chk>nul2>nul

del/f/s/q%systemdrive%*.old>nul2>nul

del/f/s/q%systemdrive%recycled*.*>nul2>nul

del/f/s/q%windir%*.bak>nul2>nul

del/f/s/q%windir%prefetch*.*>nul2>nul

rd/s/q%windir%temp&md%windir%temp>nul2>nul

del/f/q%userprofile%cookies*.*>nul2>nul

del/f/q%userprofile%recent*.*>nul2>nul

del/f/s/q"%userprofile%LocalSettingsTemporaryInternetFiles*.*">nul2>nul

del/f/s/q"%userprofile%LocalSettingsTemp*.*">nul2>nul

del/f/s/q"%userprofile%recent*.*">nul2>nul

echo----------------------------------------------------------------------

echo系统垃圾文件已经清理完成.

gotowhzq1

::---------------------⑤更改IE标题---------------------

:ggie

setyszy=""

echo-------------------请输入你需要的IE标题.复制进去也行-------------------

echo-------------------直接回车=母盘专区Q=退出-------------------

set/pyszy=

if/i"%yszy%"==""""(gotowhzq)

if/i"%yszy%"=="q"(exit)

REGADD"HKCUSOFTWAREMicrosoftInternetExplorerMain"/v"WindowTitle"/tREG_SZ/d"%yszy%"/F>nul

echo----------------------------------------------------------------------

echoIE标题已经更改为%yszy%.

gotowhzq1

::---------------------⑥显|隐系统.隐藏文件·夹--------------------

:xywj

setyszy=""

echo-------------------输入X显示输入Y隐藏-------------------

echo-------------------直接回车与乱输入=母盘专区Q=退出-------------------

set/pyszy=

if/i"%yszy%"==""""(gotowhzq)

if/i"%yszy%"=="x"(setxy=1&setyszy=显示&gotoxywj1)

if/i"%yszy%"=="y"(setxy=0&setyszy=隐藏&gotoxywj1)

if/i"%yszy%"=="q"(exit)

gotowhzq

:xywj1

REGADDHKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced/vHidden/tREG_DWORD/d%xy%/F>nul

echo----------------------------------------------------------------------

echo系统·隐藏.文件.文件夹已经%yszy%.刷新即可见到状态.

gotowhzq1

::---------------------⑦清除-桌面右键多余菜单--------------------

:qcyj

regsvr32/u/sigfxpph.dll>nul2>nul

regdeleteHKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlers/f>nul

regaddHKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersnew/ve/d{D969A300-E7FF-11d0-A93B-00A0C90F2719}>nul

echo----------------------------------------------------------------------

echo桌面多余右键菜单已清除完成.

gotowhzq1

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新DOS/BAT学习
热门DOS/BAT学习
脚本专栏子分类