Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: A batch file to delete files based on time created/modified  (Read 26885 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke



    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: A batch file to delete files based on time created/modified
« Reply #15 on: October 05, 2014, 05:25:12 AM »
Quote
Beware the ana1 probe... ;)

Seeing this statement and Foxidrives men in black picture with what Will is holding jumped out at me as wrong..... just saying  :-X

 :o

 ;D

Salmon Trout

  • Guest
Re: A batch file to delete files based on time created/modified
« Reply #16 on: October 05, 2014, 05:27:57 AM »
Nice one, foxidrive. I won't say anything about the double-colon comment lines...

I had previously prepared a bunch of jpg files for which I had modified the creation, modification, and access stamps to all be the same, starting at 01-01-2014 00:00, at 5 minute intervals to 23:55 on the same day, so in my test case the mod time was also the creation time. To make the test timestamps I used Nircmd with the setfiletime option (I didn't do this manually!)

Code: [Select]
                                          CREATED               MODIFIED              ACCESSED
nircmd.exe setfiletime "filename001.jpg" "01-01-2014 00:00:00" "01-01-2014 00:00:00" "01-01-2014 00:00:00"
etc


Salmon Trout

  • Guest
Re: A batch file to delete files based on time created/modified
« Reply #17 on: October 05, 2014, 05:31:16 AM »
Seeing this statement and Foxidrives men in black picture with what Will is holding jumped out at me as wrong..... just saying  :-X

So wrong it's right, by any chance?

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: A batch file to delete files based on time created/modified
« Reply #18 on: October 05, 2014, 05:59:36 AM »
Seeing this statement and Foxidrives men in black picture with what Will is holding jumped out at me as wrong..... just saying  :-X

 :o

 ;D

So wrong it's right, by any chance?

"The Truth is out there!" - Mulder

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: A batch file to delete files based on time created/modified
« Reply #19 on: October 05, 2014, 04:30:26 PM »
Well sir I was abducted by aliens and ever since then I have been looking for a little pay back.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: A batch file to delete files based on time created/modified
« Reply #20 on: October 05, 2014, 08:26:30 PM »
I'm actually still abducted by said aliens.  It's nice up here.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

Jerm



    Greenhorn

    • Experience: Experienced
    • OS: Windows 7
    Re: A batch file to delete files based on time created/modified
    « Reply #21 on: November 26, 2017, 09:23:53 PM »
    Hi guys, necroing this thread-

    I have the same problem as OP. Large scale construction project timelapse where I only need photos from between certain times of day every day.

    I'm trying to use the scripts posted by salmontrout and foxi. I can get them to run but they're deleting every photo, regardless of timestamp.

    I'm a pretty big noob when it comes to this stuff. Does anyone have any insight into what my problem could be? I've changed the directory path and start/end times to suit my purposes but the scripts keep deleting every photo instead of just the photos outside of the time range I specify.

    Thanks in advance!

    Jeremy

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: A batch file to delete files based on time created/modified
    « Reply #22 on: December 11, 2017, 09:56:39 AM »
    It's best to start a new Topic...provide as many details as you can...

    Not everyone reads old Posts...
    " Anyone who goes to a psychiatrist should have his head examined. "

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: A batch file to delete files based on time created/modified
    « Reply #23 on: December 11, 2017, 11:08:54 AM »
    Noticed that Lemonilla stated on October 05, 2014, 10:26:30 PM

    Quote
    I'm actually still abducted by said aliens.  It's nice up here.

    ... Looks like last visit to earth by her to visit us here on CH was Sept. 26, 2016

    Haven't seen her around in a while and went looking to see when last active.  ;D  It must be nice up there!  :P

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: A batch file to delete files based on time created/modified
    « Reply #24 on: December 11, 2017, 11:11:25 AM »
    Noticed that Lemonilla stated on October 05, 2014, 10:26:30 PM

    ... Looks like last visit to earth by her to visit us here on CH was Sept. 26, 2016

    Haven't seen her around in a while and went looking to see when last active.  ;D  It must be nice up there!  :P

    Heee... 8)
    " Anyone who goes to a psychiatrist should have his head examined. "