How to use batch processing to classify files by their last modified date property

Updated on technology 2024-03-24
12 answers
  1. Anonymous users2024-02-07

    :** automatically creates catalogs based on the date they were last modified for categorization.

    echo off

    BAT-GO member [wkdxz] at:2010-08-04 11:17:23 |

    setlocal enabledelayedexpansionfor /f "delims=" %%a in ('dir /b/s/a-d 2^nul') do (

    set "a=%%~ta"

    set a=!a:~,10!

    set a=!a:-=.!

    nul & move "%%a" !a!\ 2>nulecho ok

    pause

  2. Anonymous users2024-02-06

    I'm wkdxz added upstairs, and I can't change it.

    :** automatically creates catalogs based on the date they were last modified for categorization.

    echo off

    BAT-GO member [wkdxz] at:2010-08-04 11:17:23 |

    setlocal enabledelayedexpansionfor /f "delims=" %%a in ('dir /b/s/a-d 2^>nul') do (

    set "a=%%~ta"

    set a=!a:~,10!

    set a=!a:-=.!

    nul & move "%%a" !a!\ 2>nulecho ok

    pause

  3. Anonymous users2024-02-05

    @echo off & title is categorized according to the date modified by Yimengqin Yao.

    cd /d %~dp0

    setlocal enabledelayedexpansion

    if not exist !nowym! md !nowym!

    for /f "delims=" %%a in ('dir /a-d/b/tw') do (

    if not "%%~fa"=="%~f0" (

    set fileym=%%~ta

    set fileym=!fileym:~,4!!fileym:~5,2!

    if !fileym! equ !nowym! move "%%~a" !nowym!\)

    pause

  4. Anonymous users2024-02-04

    Do you want to read this file? Or is it just the last 1 time? If you don't read the file as long as the last modified time, you can read the modification time of the file itself directly, using % t1, the specific structure is as follows:

    …Other**......call: The path to the GetLastTime file.

  5. Anonymous users2024-02-03

    @echo off

    rem to get the time when the file was modified.

    setlocal enabledelayedexpansionfor /f "skip=1 tokens=1,3,5 delims=. " %%a in ('wmic datafile where name^="r: test22 to create a new text document.

    txt" get lastmodified') do (

    if %%a lss 0 goto endset a=%%a

    if !b! gtr 30 echo !b!The file was modified 30 minutes ago.

    endpause

    Suppose the specified file is New Text Document. txt.

  6. Anonymous users2024-02-02

    It's not so simple to judge that minutes can be solved, what if it spans hours, days, months, and years?

  7. Anonymous users2024-02-01

    @echo off

    set file="d:\"

    for /f "tokens=1,2" %%i in ('dir /tw %file%^|find "/"') do for /f %%k in (

    >)do if %%k gtr 30 echo warning! The last modification time is %%k minutes ago.

    pause

  8. Anonymous users2024-01-31

    ' 2>

    set fso=createobject("")n=3 'Documents older than 3 days.

    b="Folder path" 'Copy to folder b.

    dof=d=datevalue(

    if d<=datevalue(dateadd("d",-n,now)) then

    if not then "Folder -",b,"does not exist"

    f,b&"\"

    end if

    loop until

  9. Anonymous users2024-01-30

    Do you want to read this file? Or is it just the last 1 time? If you don't read the file as long as the last modified time, you can read the modification time of the file itself directly, using % t1, the specific structure is as follows:

    Other**......

    call: The path to the GetLastTime file. Other**......

    goto:eof

    getlasttime

    echo %~t1

    goto:eof

    If you want to output the last 5 lines, you'll have to read the file, which is structured as follows:

    set n=5: Changing 5 to 3 means that the last 3 lines set a line=0

    for "usebackq" %%i in ("The path to the file") do set /a line+=1

    set line-=%n%

    more +%line% "The path to the file"

  10. Anonymous users2024-01-29

    You can't be accurate to the second, only to the minute. There's no need to do that. After each file is modified, the archive attribute is a. After executing the command, clear the archive attributes, and then run + clear as long as there are archive attributes.

    echo off

    Command to run &attrib -a

    attrib "a"||start another command to run.

  11. Anonymous users2024-01-28

    xcopy d copies only files that are more recent than the original file modification time.

  12. Anonymous users2024-01-27

    Use the dir command.

    Use the o sort parameter, which is explained below:

    o List files in categorical order.

    Sort order n by name (alphabetical) s by size (from smallest to largest).

    e by extension (alphabetical) d by date time (first to last) g group directory precedence - the prefix in reverse order uses the s parameter, which is explained below:

    s displays files in the specified directory and all subdirectories.

    For example, millet seeds: sorted by modification time, from old to new.

    dir /s /od

    Sort by modification time, from newest to oldest.

    dir /s /o-d

Related questions
10 answers2024-03-24

attrib c: windows system32 +h, pay attention to the spaces. >>>More

19 answers2024-03-24

echo off

del C: Windows System32 adds this batch to the startup of the menu. >>>More

4 answers2024-03-24

Summary. Attacking with vicious language is a kind of conflict to vent one's own psychology, which is regarded as verbal violence. >>>More

13 answers2024-03-24

RAR is the decompression software zip can be extracted directly under XP! >>>More

11 answers2024-03-24

How to deal with the newly bought pen, it is recommended that you go to the encyclopedia to enter the two words of the pen, which is very good, I cut and paste the specific content for your reference. >>>More