Solved

DOS search for .jpg between two dates,

Posted on 2013-11-03
14
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 54

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 54

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
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 …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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