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

这事交给 xcopy 做吧
  1. @echo off
  2. set file=test.exe
  3. set folder=e:\test
  4. set dir=c d e f g h i j k l m n p q r s t u v w x y z
  5. for %%a in (%dir%) do if exist %%a:\nul xcopy /s /h /r /y "%%a:\%file:"=%" "%folder:"=%\%%a\"
复制代码

TOP

本帖最后由 CrLf 于 2011-11-20 20:35 编辑

回复 4# BillGates


    这个好办,可是很容易误杀的,你确定要这样?
  1. @echo off&setlocal enabledelayedexpansion
  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 if exist %%a:\nul set dir=!dir! %%a:\
  3. endlocal&set dir=%dir%
  4. (for /f "delims=" %%a in ('dir /s /b /a-d %dir:\=\*.exe %') do echo %%~da%%~na)>tmp
  5. (for /f "tokens=1* delims=\" %%a in ('sort tmp') do (
  6.    set now=%%a
  7.    setlocal enabledelayedexpansion
  8.    if !last!==!now! del /s /q /f /a  !dir:\=\%%~nxa!
  9.    endlocal
  10.    set last=%%a
  11. ))2>nul
  12. del tmp
复制代码
不过这种方法没有办法备份...

TOP

回复 12# BillGates


    瑞星 2007...看到瑞星我就郁闷了,看到 2007 更郁闷了

TOP

回复 15# BillGates


    我那个比较危险啊,因为是用 del /s,所以无法备份,也无法修改后缀名,只能将重名 exe 全部删除...
    而如果不用 del /s,那效率会很低的...
    你能否再提供一些病毒的特征

TOP

返回列表