- @echo on&setlocal enabledelayedexpansion
- for /f "skip=1 delims=" %%a in ('wmic datafile where name^="D:\\a.txt" get CreationDate')
-
- do (
- set num=%%a
- set n=!num:~,4!
- set y=!num:~4,2!
- set r=!num:~6,2!
- set riqi=!n!-!y!-!r!
- )
- if !riqi!==%date:~,10% (start A.bat) else (start b.bat)
- pause
复制代码 假设a.txt的在D盘,如果不是就把里面a.txt所在的路径换了,把\都换成2个\ |