本帖最后由 liumtz 于 2016-11-3 22:59 编辑
回复 liumtz
楼主请学会用 pause 做断点, echo on 开回显, echo %var%, set var, rem 怀疑有问题的代 ...
aa77dd@163.com 发表于 2016-11-3 21:54
是拼写错误导致的,可是问题又来了,请看下面的代码,按下任意键CMD窗口就消失了,是if defined exe那里有问题吗?帮忙调试下,谢谢!- @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 ◇"!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%"☆
- pause
- if defined exe (
- echo 断点1
- if not "%exe%"==""(
- echo 断点2
- ::if not exist %exe%\ del /f /q %exe%
- ::sc delete Distribuobj
- ))
- goto :eof
-
- echo ☆☆☆☆☆☆☆☆☆☆☆
-
- :end
- echo.
- echo.
- echo LPK已清除完毕,请现在重启电脑,重启后免疫将生效
- echo.
- echo.
- echo ---------------------请按任意键退出该程序或直接关闭此窗口--------------------
- pause>nul
复制代码
|