<div class="content-rich-box rich-text-" ><div class="law-answer-wrapper-highlight">以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI
@echo off
rem 计算两个指定文件修改时间相差的秒数
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
set "file1=D:\xxx\文件1"
set "file2=D:\xxx\文件2"
if not exist "%file1%" (echo;"%file1%" not found&pause&exit)
if not exist "%file2%" (echo;"%file2%" not found&pause&exit)
>"%tmp%\v.v" echo;Set fso=CreateObject("Scripting.Filesystemobject")
>>"%tmp%\v.v" echo;Set f1=fso.GetFile(WSH.Arguments(0))
>>"%tmp%\v.v" echo;Set f2=fso.GetFile(WSH.Arguments(1))
>>"%tmp%\v.v" echo;s=DateDiff("s",f1.DateLastModified,f2.DateLastModified)
>>"%tmp%\v.v" echo;WSH.echo Abs(s):WSH.Quit
cscript -nologo -e:vbscript "%tmp%\v.v" "%file1%" "%file2%"
echo;%#% +%$%%$%/%@% %z%
pause
exit |