我正在尝试使用批处理更新多个文件和更新版本,我目前不想工作。新文件和旧文件之间唯一不同的是日期,然后我将循环它,因为要替换的文件目录稍微改变为c:\ test3 \ hazard-file2-data.csv。
CLS
set /p vtdate= Enter existing valid till date:
set /p yesno= Confirm this is the correct valid till date?[y/n/c to cancel]:
if "%yesno%"=="n" goto VTD
if "%yesno%"=="y" goto VFD
if "%yesno%"=="c" goto Home
if not "%yesno%"=="y"or"n"or"c" goto IED
pause
goto VTD
:VFD
set /p vfdate= Enter valid from date:
Set /p yesno= Confirm this is the correct valid from date?[y/n/c to cancel]:
if "%yesno%"=="n" goto VFD
if "%yesno%"=="y" goto Copy
if "%yesno%"=="c" goto Home
if not "%yesno%"=="y"or"n"or"c" goto VFD
pause
goto VFD
:Copy
cd c:\>replace c:\Test2\"%vfdate%"-hazards-File1-data.csv:\Test1\"%vtdate%"-hazards-File1-data.csv