[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] 批处理怎么删除所有盘下所有目录的lpk.dll?

怎么删除所有盘下所有目录的lpk.dll?
比如C盘,D盘,E盘
各个目录下的各个lpk.dll
都想删除删除之前还要执行以下针对lpk.dll
执行attrib -r -a -s -h /s /d lpk.dll
del /s /q lpk.dll
怎么嵌套循环起来呢?

听说LPK.DLL 是勒索病毒。其实系统自带也有这个文件。下面的排除系统目录。
  1. @echo off
  2. ::UAC
  3. >nul 2>&1 "%Windir%\system32\cacls.exe" "%Windir%\system32\config\system"
  4. if %errorlevel% NEQ 0 (echo UAC……& goto UACPrompt) else goto gotAdmin
  5. :UACPrompt
  6. echo Set UAC = CreateObject^("Shell.Application"^) > "%Temp%\getadmin.vbs"
  7. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%Temp%\getadmin.vbs"
  8. "%Temp%\getadmin.vbs"
  9. exit /B
  10. :gotAdmin
  11. del /f /q "%Temp%\getadmin.vbs">nul 2>&1
  12. for %%a in (C D E) do (
  13. echo 检查 %%a 盘中...
  14. for /f "delims=" %%c in ('dir/a-d/b/s "%%a:\lpk.dll"') do (
  15. if exist "%%c" (
  16. echo %%c|findstr /iv "System32 SysWOW64 WinSxS" && (
  17. takeown /f "%%c"
  18. icacls "%%c" /grant administrators:F
  19. attrib -r -s -h "%%c"
  20. del /q /f "%%c"
  21. )
  22. )
  23. )
  24. )
  25. pause
复制代码

TOP

回复 6# HughRyu


    邮件单击bat文件,以管理员方式运行,试试可以吗?
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Wind
ows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Wind
ows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Window
s\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Window
s\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\
System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\
SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\Sy
stem32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\Sy
sWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\Syst
em32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysW
OW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System
32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW
64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32
\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64
\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\l
pk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\l
pk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk
.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk
.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.d
ll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.d
ll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll

拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll

拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\D\Windows\System32\lpk.dll
拒绝访问 - C:\D\Windows\SysWOW64\lpk.dll
拒绝访问 - C:\Windows\System32\lpk.dll
拒绝访问 - C:\Windows\SysWOW64\lpk.dll
C:\Windows\System32\lpk.dll
拒绝访问。
C:\Windows\SysWOW64\lpk.dll
拒绝访问。

最后结果是这样的...这个感觉怪怪的....耗时很久....

TOP

回复 4# Batcher


正在处理 C:\
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Wind
ows\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Wind
ows\SysWOW64\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Window
s\System32\lpk.dll
拒绝访问 - C:\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\D\Window
s\SysWOW64\lpk.dll

执行就出现这样的字样,然后开始无限循环...

TOP

  1. @echo off
  2. for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
  3.     if exist %%a:\ (
  4.         pushd %%a:\
  5.         echo 正在处理 %%a:\
  6.         attrib -r -a -s -h /s /d lpk.dll
  7.         del /s /q lpk.dll
  8.         popd
  9.     )
  10. )
  11. pause
复制代码
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

attrib -r -s -h /s /d c:\lpk.dll & del /s /q c:\lpk.dll
在脚本前加入管理员权限。或用PS调用 RUNAS 。
先自行修改PS的执行策略改成最高。删除后再改回来。
  1. start "$pshome\powershell.exe" -ArgumentList "-noprofile -command `
  2. &attrib -r -s -h /s c:\lpk.dll;`
  3. &attrib -r -s -h /s d:\lpk.dll;`
  4. &attrib -r -s -h /s e:\lpk.dll;`
  5. del c:\lpk.dll -rec -force;`
  6. del d:\lpk.dll -rec -force;`
  7. del e:\lpk.dll -rec -force;" `
  8. -verb runas;
复制代码

TOP

有专杀工具。

TOP

返回列表