这是我的代码,当我假设你不存在时,它似乎总是认为 %filePath% 存在。完全没有P:\Production\Database_backup\02182014-Database0400.mdb
。在将其用于生产数据库之前,我的桌面仅用于测试
set "PublishDest=P:\Production\Database_backup\"
set source=C:\Users\kevin\Desktop\Database0400.md*
:Main
set "currDate=%date:~4,2%%date:~7,2%%date:~10,4%"
Set "fileName=%currDate%-Database0400.mdb"
Set "filePath=%PublishDest%%fileName%"
if exist %filePath% (
ECHO %filePath%
ECHO you made it in here!
PAUSE
::IF prev backup on same day, increment all old backups and move current to first old
call:IncrementArchives
Echo.
)