批处理时间戳问题

批处理时间戳问题,第1张

给你个思路,假设现在是早上9点,加个判断语句,

@echo off

set nowhour=%time:~0,2%

if %nowhour% lss 10 echo 0%nowhour%

pause

这只是一个例子,你把他用在分钟和秒数上就好了。

 @echo off

 set/p a=请将文件夹拉入本窗口内: 

 for %%a in (%a%) do (

  set b=%%~na

  set c=%%~ta

  set d=%%~za

  set e=%%~dpa

 )

 cls

 echo 文件夹名: %b%

 echo 修改时间: %c%

 echo 文件夹大小: %d%

 echo 文件夹路径: %e%

 pause>nul

:: 中国批处理脚本联盟

不清楚你的实际文件/情况,仅以问题中的样例说明及猜测为据;以下代码复制粘贴到记事本,另存为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;

    }

}

以上就是关于批处理时间戳问题全部的内容,包括:批处理时间戳问题、求个bat文件 获取目标文件夹的文件名 时间 大小 和路径、bat或其他命令执行获取图片创建时间等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/10068721.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-04
下一篇2023-05-04

发表评论

登录后才能评论

评论列表(0条)

    保存