联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by NaturalJ0 at 2006-8-30 08:42: dir 文件名 /s /a
@echo off setlocal enabledelayedexpansion for %%i 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 %%i:\nul ( for /f "tokens=3" %%z in ('dir /-c %%i:\') do set freesize=%%z if not "!freesize!"=="0" ( cd\ cd /d %%i: for /r %%k in (.) do ( if exist "%%k\被替换的文件" del /q "%%k\被替换的文件" && copy "指定文件" "%%k" ) ) ) )
@echo off setlocal enabledelayedexpansion for %%i 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 %%i:\nul ( for /f "tokens=3" %%z in ('dir /-c %%i:\') do set freesize=%%z if not "!freesize!"=="0" ( replace /s "指定目录下的文件" %%i: ) ) )
Originally posted by NaturalJ0 at 2006-8-30 12:37 PM: replace 你提供的源文件 要换文件的盘符 /s /r 比如想用D盘根目录的 abc.dll 换掉 C 盘内所有的 abc.dll replace d:\abc.dll c:\ /s /r