Solved

DOS search for .jpg between two dates,

Posted on 2013-11-03
14
389 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 56

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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 56

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

622 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