Created
January 4, 2018 10:51
-
-
Save on195594/bacf2c94699ac39aa0a012ed5b6878b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem 要替换这些文件夹中的一个文件,注意是文件,不是目录 | |
rem 假设用D:\Data\123.txt替代D:\testData\下面所有的123.txt | |
set filename=123.txt | |
set pathname=D:\testData | |
set srcfile=D:\Data\123.txt | |
for /f "delims=" %%i in ('dir %pathname%\%filename% /s /b /a-d') do ( | |
echo %%i | |
copy "%srcfile%" "%%i" /y | |
) | |
echo OK | |
pause>nul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment