Computing.Net > Forums > Disk Operating System > Can I print a 'find file' list?

Can I print a 'find file' list?

Reply to Message Icon

Original Message
Name: wolfpeach
Date: December 8, 2003 at 09:59:58 Pacific
Subject: Can I print a 'find file' list?
OS: win98
CPU/Ram: 1ghz piii
Comment:

Hi all -

Does anyone know a DOS command that would print (or save to a txt file) a list of all files on a drive that have been created or modified after a certain date, or between two dates.

I'm looking for something like the 'find file' utility in win98, but with the capacity to save or print out a list of file names/times created.

Could I do this with xcopy?


Report Offensive Message For Removal


Response Number 1
Name: Johns
Date: December 8, 2003 at 13:57:38 Pacific
Reply: (edit)

You may want to look into the simple DIR command.

Use DIR /? to see the switches you can use.

then use "dir (swithches you want) >>log.txt"

with out the ""

this will print the info to a log.txt file.


Report Offensive Follow Up For Removal

Response Number 2
Name: wolfpeach
Date: December 9, 2003 at 01:11:08 Pacific
Reply: (edit)

Thanks Johns!

I did a bit of reading and came up with:

DIR C:\ /o:d /s >a:listlog.txt

Which came up with a whole load of directories with the files sorted chronologically in each one.

Is there any way I can get just a single list of files, in date order (ie, not broken up into directories)?


Report Offensive Follow Up For Removal

Response Number 3
Name: IVO
Date: December 9, 2003 at 02:47:16 Pacific
Reply: (edit)

Add the /B switch to your statement

DIR C:\ /o:d /s /b > a:listlog.txt


Report Offensive Follow Up For Removal

Response Number 4
Name: wolfpeach
Date: December 9, 2003 at 03:19:08 Pacific
Reply: (edit)

Thanks IVO -

That gave a bare list of just file names/paths without any other information, but it was still divided into directories.

Sorry, I'll try to be more specific :-)

When I said 'just a list', I actually meant a list of files + the time/date they were created, sorted chronologically, independent of which folder they are in.

Can this be done with DIR, or maybe with the output of DIR piped to some other command?


Report Offensive Follow Up For Removal

Response Number 5
Name: Mick C
Date: December 9, 2003 at 05:03:39 Pacific
Reply: (edit)

I think what you need to do is add the SORT command to the end of your DIR statement.

i.e. DIR /o:d/s|SORT/+01|MORE
to print to screen one page at a time
to test result or
>LISTLOG.TXT in place of |MORE
as other examples tp create file.

Using differant setting +01 to +20 give differant results.


Report Offensive Follow Up For Removal


Response Number 6
Name: wolfpeach
Date: December 9, 2003 at 05:27:21 Pacific
Reply: (edit)

Hi Mick -

Funny you should mention that - I've been experimenting with the 'sort' command, but havent had any luck.

I can get it to sort the files with all the the same days together (eg, every '29th' of each month) or months, or years, but thats not very useful! I'm after a single chronological string of dated files, so that I can look at specific time slots and check to see what was going on (I've got several dozen pcs to monitor).

If I could get the date in astronomical format (yyyy/mm/dd) then it would be a cinch...

Thanks anyway. :-)

Any other ideas?? There *must* be a way to do this!


Report Offensive Follow Up For Removal

Response Number 7
Name: Mick C
Date: December 9, 2003 at 07:48:07 Pacific
Reply: (edit)

The way DOS handles dates is dependant on which codepage you use.

Take a look at my codepage reference at:

http://www.oldstuff.myagora.net/powerload/codepage.htm

for which codepages list in astronomical format

I think you can change the setting for a single session by using the KEYB command.

i.e. KEYB ye for Yugoslavia
which uses the date setting of yyyy-mm-dd
and is still a basic QWERTY Keyboard.

You could change the Keyboard from US to YE for listing, and back to US after.
(Assuming you are from the USA)

I do not have access to pure DOS at the moment (Windows XP's emulated DOS is lacking in utilites such as KEYB) But I think that is how it was done!


Report Offensive Follow Up For Removal

Response Number 8
Name: IVO
Date: December 9, 2003 at 13:13:58 Pacific
Reply: (edit)

I have carefully examined your question and exploited any variant in available commands under DOS based Windows environments (Win 9X/ME); in my opinion, but I hope I am wrong, the problem has no solution via plain batch scripting: some programming is needed to achieve the desidered target.

Different is the diagnosis if the operating environment was an NT based system (Win NT/2K/XP) where you can rely on the more powerfull extended batch language. There the goal can be achieved quite easily. But that is another story.


Report Offensive Follow Up For Removal

Response Number 9
Name: wolfpeach
Date: December 9, 2003 at 14:46:14 Pacific
Reply: (edit)

Mick, thanks for the suggestion - bizarre, but it works! (I'm in the UK, btw) :-) Good old Yugoslavia!! ;-)

Using the keyb command from DOS does nada, but changing autoexec.bat & config.sys as per your suggestion (and rebooting) hits the mark. Only drawback is that the keyboard is all over the place whilst using the command prompt (for some reason fine under windows!) & "\" is nowhere to be found... Nevermind, worked in notepad & pasted. :-)

Have written a couple of batch files as follows to automate the whole thing (I need to run this on about 50 machines...).

Thanks again everyone!

Here's the lowdown for anyone else wanting to try this:

#batch file 1
#rem use copy to backup original autoexec.bat & config.sys
copy c:\autoexec.bat c:\autoexec~.bat
copy c:\config.sys c:\config~.sys

#rem replace autoexec & config with yugoslavian keyboard & then reboot manually
copy /y a:\autoexec.bat c:\autoexec.bat
copy /y a:\config.sys c:\config.sys

#rem batch file 2

#rem run dir command piped to sort to list c drive chronologically
dir c:\ /s /a-d /od | sort /+30 >c:\listlog.txt
copy c:\listlog.txt a:\list.txt

#rem restore original autoexec.bat & cnfig.sys
copy /y c:\autoexec~.bat c:\autoexec.bat
copy /y c:\config~.sys c:\config.sys

# modified autoexec etc:

#autoexec.bat: (yu)

mode con codepage prepare=((852) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=852
keyb yu,,C:\WINDOWS\COMMAND\keyboard.sys

#config.sys: (yu)

DEVICE=C:\WINDOWS\setver.exe
device=C:\WINDOWS\COMMAND\display.sys con=(ega,,1)
Country=038,852,C:\WINDOWS\COMMAND\country.sys


Report Offensive Follow Up For Removal

Response Number 10
Name: Mick C
Date: December 9, 2003 at 16:08:23 Pacific
Reply: (edit)

Yes I must admit its an odd way to do it!

As IVO puts it problem has no solution via plain batch scripting

It is possible that someone may still come up with a simple solution, but if you are happy with what you have now, It can only get better! Probably a custom program is needed. All we need is someone to write it.

According to the diagram in the MS-DOS 6.2 handbook, \ is located with the Q key. (Shift or Alt Q?) and | is with the W key.

Regards, Mick C - North Yorkshire


Report Offensive Follow Up For Removal

Response Number 11
Name: Wolfpeach
Date: December 15, 2003 at 09:14:55 Pacific
Reply: (edit)

One extra thing I have found is that the DOS DIR command is not very good at displaying files in hidden or systems folders, even with the right flags (/ah /as etc).

As I wanted *every* file on the pc listed, and was particularly interested in getting at logs of temp internet files, for forensics, this was a problem. Upgrading the command.com to the version from DOS 7.1 makes it possible - see
http://www.computing.net/dos/wwwboard/forum/14338.html
for details (thanks Wengier!)


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Can I print a 'find file' list?

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge