- @echo off
- for /f "tokens=2 delims==" %%i in ('wmic datafile where "Name='D:\\tyhj\\日报.xls'" get LastModified /value ^| findstr "="') do (
- set "StrDate1=%%i"
- )
- set "FileDate=%StrDate1:~0,8%"
-
- for /f "tokens=2 delims==" %%i in ('wmic path win32_operatingsystem get LocalDateTime /value ^| findstr "="') do (
- set "StrDate2=%%i"
- )
- set "SysDate=%StrDate2:~0,8%"
-
- if "%FileDate%" equ "%SysDate%" (
- echo Yes
- ) else (
- echo No
- )
- pause
复制代码
|