本帖最后由 aa77dd@163.com 于 2016-11-3 23:13 编辑
回复 9# liumtz
楼主你要学的还有细心, 编写代码要有好的编辑习惯, 缩进格式是最基本的, 不细心的习惯: 常拼写错误, 空格一下有, 一下没有; 标签冒号一下有, 一下没有? 如果 CMD 解释器能说话, 它只会对你说: 我已经崩溃了!
你的代码为什么没有缩进格式?
if 后的复合语句前的左括号前 要 有 空格- @echo off
-
- echo ◇◇◇◇◇◇◇◇◇◇
-
- ::Distribuobj,Distribuxwc
- ::reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs" /v lpk /t REG_SZ /d "lpk.dll" /f > nul
- ::sc config Distribuobj start= disabled > nul
- ::net stop Distribuobj > nul
-
- setlocal enabledelayedexpansion
-
- for %%i in (spooler,eventlog) do (
-
- set exePath=
- for /f "skip=1 delims=" %%a in ('wmic service where Name^="%%i" get PathName') do (
- set exePath=%%a
- )
- echo [!exePath!]
- echo;WatchPoint 20161103_230545
- set exePath
- echo ◇"!exePath!"◇
- if defined exePath (
- if not "!exePath!"=="" call :lis !exePath!
- )
- )
-
- ::endlocal
-
- goto :end
-
-
- :lis
- echo "%*"
- set exe=
- for /f "delims=" %%b in ('echo %*^|findstr /r /i "^%SystemDrive%\\windows\\system32\\.*\.exe$"') do (
- set exe=%%b
- )
- echo ☆"%exe%"☆
- set exePath
- pause
- if defined exePath (
- echo 断点1
- if not "%exe%"=="" (
- echo 断点2
- ::if not exist %exe%\ del /f /q %exe%
- ::sc delete Distribuobj
- )
- )
- pause
- goto :eof
-
- echo ☆☆☆☆☆☆☆☆☆☆☆
-
- :end
- echo.
- echo.
- echo LPK已清除完毕,请现在重启电脑,重启后免疫将生效
- echo.
- echo.
- echo ---------------------请按任意键退出该程序或直接关闭此窗口--------------------
- pause>nul
复制代码
|