Solved

DOS search for .jpg between two dates,

Posted on 2013-11-03
14
376 Views
Last Modified: 2014-06-11
I need to find photo on a hard drive between two dates. The date is a birth of a child and pics are missing, I have a back up.

Dir *.jpg /s  

But how to get say between 1.1.2000 and 1.1.2001. ?
0
Comment
Question by:fcek
  • 4
  • 2
  • 2
  • +4
14 Comments
 
LVL 20

Expert Comment

by:n2fc
ID: 39619755
Add /OD (i.e. dir *.jpg /s /od)   to additionally sort by date
0
 
LVL 53

Expert Comment

by:Bill Prew
ID: 39619759
I'm away from a computer right now, but since this is a one time need, I'd suggest just taking the output of DIR and piping it into a find to get you close.  In your case it seems like you think it would have a year of 2000, so perhaps something like:

dir /s /a-d *.jpg | find "2000 "

This will get you some file names, but then you will have to locate their folders, so you can take a file name and do:

dir /a-d /s /b c:\filename.jpg

It's a little crude, but might help you track them down.

On the first DIR you might consider the option to specify the create date rather than the modified date, although if you know you never edited the pictures than that may not matter. If you do DIR /? You can see the various options.

~bp
0
 
LVL 34

Expert Comment

by:Michael-Best
ID: 39619768
by date: dir /o:d
by name: dir /o:n
by size: dir /o:s
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:peea
ID: 39619772
Let's assume that no file name contains "2000" or "2001", you may use two DIR + FIND to list the related pictures.

DIR \*. JPG /S | FIND "2000" > B.TXT
DIR \*. JPG /S | FIND "01/01/2001" >> B.TXT
TYPE B.TXT

B.TXT will contain a list of all pictures taken in 200 and on 1/1/2001.
0
 
LVL 15

Expert Comment

by:Giovanni Heward
ID: 39619812
Here's an approach which satisfies your requirements.  Bear in mind processing time may be lengthy.

@echo off
setlocal enabledelayedexpansion
set startdate=20000101
set enddate=20010101
set output=%temp%\results.txt
set ext=jpg
set drive=C:
set location=%userprofile%\Documents
set location=!location:\=\\!
set location=!location:~2!
echo Searching drive !drive! @ !location!...
wmic datafile where "drive='!drive!' and path like '!location!\\%' and extension='!ext!' and filesize>'0' and lastmodified>'!startdate!' and lastmodified<'!enddate!'" get InstallDate, LastModified,LastAccessed, Name>!output!

Open in new window


Modify the startdate, enddate, drive and first location variable to reflect your target.

startdate and enddate expressed as YYYYMMDD
drive is expressed as X:
location is express as X:\FOLDER\PATH
0
 

Author Comment

by:fcek
ID: 39620090
Great. Some good ideas there.

As I know the exact birth date I can start there and I can use a combination of the ideas above.

Will report back
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39620265
If you can't find and you have made any amendments to the photo, even rotated it don't forget it could have a different date...
0
 

Author Comment

by:fcek
ID: 39628294
Thanks.
0
 

Author Comment

by:fcek
ID: 39628696
x66_x72_x65_x65

Id like to give that a try.  Ive saved everything to an ext drive called X:
There are subfolders but the top folder is called say .....   ABC
There are no userprofiles as Ive moved my docs to its root (from XP) in there.  

Im making a batch file out of that I presume?
 
Thanks
0
 
LVL 15

Accepted Solution

by:
Giovanni Heward earned 250 total points
ID: 39628703
Exactly.  It should look something like this:

@echo off
setlocal enabledelayedexpansion
set startdate=20000101
set enddate=20010101
set output=%temp%\results.txt
set ext=jpg
set drive=X:
set location=X:\ABC
set location=!location:\=\\!
set location=!location:~2!
echo Searching drive !drive! @ !location!...
wmic datafile where "drive='!drive!' and path like '!location!\\%' and extension='!ext!' and filesize>'0' and lastmodified>'!startdate!' and lastmodified<'!enddate!'" get InstallDate, LastModified,LastAccessed, Name>!output!
if exist %temp%\results.txt type %temp%\results.txt

Open in new window

0
 
LVL 53

Assisted Solution

by:Bill Prew
Bill Prew earned 250 total points
ID: 39629144
I almost forgot one of my favorite utilities, Swiss File Knife. If you can use a small utility you might want to give this a try, it could do exactly what you need, and it's FAST!

Download from here (all you need is the sfk.exe file)

    http://stahlworks.com/dev/swiss-file-knife.html

And try a command like this:

    sfk list -since 20000101 -before 20010101 c:\temp *.jpg

~bp
0
 

Author Comment

by:fcek
ID: 39667809
Had a flu and when recovered got bogged under with work.
Getting back to this very soon and will report back
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question