Computing.Net > Forums > Programming > find todays file in one folder usei

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

find todays file in one folder usei

Reply to Message Icon

Name: vishuonly4u
Date: April 15, 2008 at 22:28:11 Pacific
OS: DOS
CPU/Ram: p5
Product: Intel
Comment:

Hello.. need ur help.
Every day at 8:00 we get one file in d:\tmp\ with file name as test1.dat*** (*** are some random numbers)
now I want to search for a todays test1.dat*** file from that folder.
That folder allready contain many old test1.dat*** files.
And I dont want to use any temp file to store results.
could pls suggest me way for this.



Sponsored Link
Ads by Google

Response Number 1
Name: devil_himself
Date: April 15, 2008 at 23:18:16 Pacific
Reply:

::Find all the files made today in a folder
@echo off & setlocal enabledelayedexpansion
for %%f in ("d:\tmp\*.*") do (
echo "%%~tf" | find "%date%" > nul
if !errorlevel! EQU 0 echo %%~tf %%~zf "%%~ff"
)


0

Response Number 2
Name: vishuonly4u
Date: April 15, 2008 at 23:30:20 Pacific
Reply:

@echo off & setlocal enabledelayedexpansion
for %%f in ("d:\tmp\*.*") do (
echo "%%~tf" | find "%date%" > nul
if !errorlevel! EQU 0 echo %%~tf %%~zf "%%~ff"
)

Dont understand how it works..
could you please explain me in short.

I was thinking of a FIND command with dir
some thing like
dir test1.dat* | find /c "current date"
this will return me the value 1 if we have file today.
but I am not able to store this value in variable. and i dont want to use a file to store this value.


0

Response Number 3
Name: vishuonly4u
Date: April 15, 2008 at 23:47:42 Pacific
Reply:

Thanks got to know how it works...
this is solution that i asked for...
many thanks.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Find & Replace Batch File Problem with BCD conversi...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: find todays file in one folder usei

can we find a file in one folder? www.computing.net/answers/programming/can-we-find-a-file-in-one-folder/14587.html

Batch Rename files in a folder www.computing.net/answers/programming/batch-rename-files-in-a-folder/15096.html

Find oldest file in folder www.computing.net/answers/programming/find-oldest-file-in-folder/14755.html