@echo off&setlocal enabledelayedexpansion
set "fn=e:\atxt"
:loop
for %%a in ("%fn%") do (
if exist "%fn%" (
for /f "tokens=1-10 delims=/-: " %%i in ("%%~ta !date:~,10! !time:~,5!") do (
set/a y1=%%i,m1=1%%j%%100,d1=1%%k%%100,h1=1%%l%%100,f1=1%%m%%100,y2=%%n,m2=1%%o%%100,d2=1%%p%%100,h2=1%%q%
%100,f2=1%%r%%100
set /a "f=(1461(y2+(m2-14)/12)/4+367(m2-2-(m2-14)/1212)/12-3((y2+(m2-14)/12)/100+1)/4-1461(y1+(m1-
14)/12)/4-367(m1-2-(m1-14)/1212)/12+3((y1+(m1-14)/12)/100+1)/4-d1+d2)1440+(h2-h1)60+f2-f1"
if !f! LSS 15 (
start 1txt
)
)
)
)
rem 延迟大约30秒后再次判断
ping /n 30 1271 >nul
goto :loop@echo off
echo %date:~5,2%月%date:~8,2%日 %time:~0,2%:%time:~3,2%
psuse
不清楚你的实际文件/情况,仅以问题中的样例说明及猜测为据;以下代码复制粘贴到记事本,另存为xxbat,编码选ANSI,跟要处理的文件放一起双击运行
<# :cls&echo off&cd /d "%~dp0"&mode con lines=5000
rem 将当前目录里多个jpg文件按照拍摄日期划分/归类到不同文件夹里
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "current=%cd%"
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$b=[Convert]::FromBase64String("IC0tPiA=");
$c=[TextEncoding]::DefaultGetString($b);
Add-Type -AssemblyName 'Systemdrawing';
$current=$env:current;
$files=@(dir -literal $current|{(@("jpg","jpeg") -contains $_Extension) -and ($_ -is [SystemIOFileInfo])});
for($i=0;$i -lt $fileslength;$i++){
$t='';
$img=[SystemDrawingImage]::FromFile($files[$i]FullName);
foreach($it in $imgPropertyItems){
if($itId -eq 0x9003){
$t=[SystemTextEncoding]::ASCIIGetString($itValue) -replace '\x00$','';
break;
}
}
$imgDispose();
if($t -ne ''){
$newfolder=($ttrim()replace(':','-') -split '\s+')[0];
if(-not (test-path -literal $newfolder)){[void][IODirectory]::CreateDirectory($newfolder);}
$files[$i]Name+$c+$newfolder;
}
}
@echo off
echo wscriptecho DateDiff("s", "01/01/1970 00:00:00", Now())>sjcvbs
for /f %%i in ('cscript sjcvbs /nologo') do echo %%i>sjcvbs
ren sjcvbs sjctxt
以上就是关于批处理bat获取文件a.txt的最后修改时间,与当前系统时间进行对比,如果小于15分钟,就打开1.全部的内容,包括:批处理bat获取文件a.txt的最后修改时间,与当前系统时间进行对比,如果小于15分钟,就打开1.、bat或其他命令执行获取图片创建时间、如何在bat里获得当前的系统时间戳等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)