【发布时间】:2014-03-18 23:08:59
【问题描述】:
这是我的代码,它似乎总是认为 %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.
)
【问题讨论】:
标签: file batch-file if-statement file-exists false-positive