每次替换表格都要挨个项目手动ctrl+V,那不如写个脚本自己copy替换
rem::date 2018-10-17
rem::author ljiemin
@echo off
setlocal enabledelayedexpansion
SET source_patch=.\Replace\str_table.xls
SET source_fload=.\Replace\
SET source_default=.\Default\str_table.xls
SET source_replace=.\Replace\str_table.xls
SET dir=.\
rem::不知道怎么判断字符串,因为会遍历到E:\work\SC7703\MS_MMI_Main\source\resource\Common_customer\Replace\,导致删除到要替换的str_table.xls
rem::所以现在这里做个备份
copy %source_patch% .\Replace\tmp.xls
copy %source_default% .\Default\str_tmp.xls
for /f "delims=" %%i in ('dir /b/a-d/s "%dir%\str_table.xls"') do (
echo %%i
del %%i
copy %source_patch% %%i
)
rem::子文件夹的替换完了,把tmp.xls删除
rem::tmp.xls改回str_table.xls
copy .\Replace\tmp.xls %source_patch%
del .\Replace\tmp.xls
copy .\Default\str_tmp.xls %source_default%
del .\Default\str_tmp.xls
pause
以上