In Windows shell, How do I echo the date of the oldest file in a directory? -


I have the following directory (which works well) with a file card for each directory for the directory In the batch file for the recursive list, but besides what I already have, I need to know the date of the old file in the current directory, where it says I_NEED_YEAR_HERE , how do I do it Can i

 @echo off setlocal disableDelayedExpansion if "% ~ 1" = "" (call: recurs. ") And call: exit the recursion% 1 / b: from the recurs to the Settleoscal Set filecant = 0 Set / set for / d %% D ("% ~ 1 \ *") ("Dyre / b / ad"% ~ 1 \ * "2 ^> null ^ | search / v / c" '') ) Is a fileCnt + = %% F)% echo %%% fileCnt% files, and the oldest file is from the year I_NEED_YEAR_HERE (Endocultial Set / A File Cnt + %% File Content%) / b 

class = "post-text" itemprop = "text">
  AECO of setlockluck set "sourcedir = U: \ sourcedir" PUSHD "% sourcedir % "Setloca L Disable Replacement Setup / AG Rand = 0 If "% ~ 1" = "" (Call: Reckers ".") And call: Rickers% 1 ECHO Total =% Grand% POPD Goto: EOF: Reakers Settoscale / D %% Call D ("% ~ 1 \ *"): recurse "%% ~ fd" set / a filecant = 0 for SET "oldest =" / f "delims =" %% F ('dir / b / ad / Od \ "% 1 \\" 2 ^> Nool ') (set / one file cnt + 1 if the oldest is not set for %% OIN ("% ~ 1 \ %% ~ nxF") Set "oldest = %% ~ tO% ~ 1 \ %% ~ nxF")% echo %%% fileCnt% files and the oldest file year% Settled from earlier% ~ 6.4 %% oldest% (Andokl set / a Grand =% Grand% +% fileCnt% test directory has been slightly improved to suit your test I: \ sourcedir.  

I set the oldest , selecting both dates and filename essential data is the case of the appropriate sub-base, and it must be taken to the file #

Intriguingly, SET / a grand =% grand% +% fileCnt% while SET / a grand + =% fileCnt% failed ...


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -