Solved

DOS search for .jpg between two dates,

Posted on 2013-11-03
14
364 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 19

Expert Comment

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

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
 
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 14

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 14

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 51

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now