LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 03-12-2007, 06:33 PM   #1
Tapupah

Join Date
Oct 2005
Posts
474
Senior Member
Default How can you list files that were modified in the last 24 hours
Ok this may sound like a daft question.

But.... I want a text file containing all the files that were modified in the last 24 hours sorted as a single file on a single line

i.e.

----list.txt-----------
c:\myfile.txt
c:\myoutherfile.txt

this is how far i have got:

dir /A-D /S /B t: > list.txt

gives me a full list

and

find /mnt/drive -type f -mtime -1 > list.txt

this works for linux but i need a batch file.
Tapupah is offline


Old 03-12-2007, 09:41 PM   #2
russmodel

Join Date
Oct 2005
Posts
462
Senior Member
Default
so you want it on a single line? For example,

c:\windows C:\program files c:\document and settings

Like that?

And what do you mean you need it in a batch file? You already have the command you need. Just but it in a *.bat or *.sh (with +x) and just run the batch file. Are you talking about creating a batch file that is more generic, or a batch file that accepts arguments? For example, being able to specify the directory to search and the name of the output file?
russmodel is offline


Old 04-12-2007, 05:57 PM   #3
Tapupah

Join Date
Oct 2005
Posts
474
Senior Member
Default
nope i need a plain test file with one filename on one line i.e.

---copy----
c:\file1.txt
c:\file2.txt
c:\file3.txt
---paste----

I know "dir /A-D /S /B C:\ > list.txt" put in a batch file would do this but i want list of files modified in the last 24 hours not every file
Tapupah is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 10:43 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity