Computing.Net > Forums > Disk Operating System > log file info to a file using batch

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.

log file info to a file using batch

Reply to Message Icon

Name: Ravi
Date: October 10, 2002 at 02:29:44 Pacific
OS: Winf NT
CPU/Ram: P-III,256MB RAM
Comment:

Hello,
I am new to DOS.
I have a specific requirement. I need to log all the file information like File Name , Directory , Date of creation/updated and the size of the file into a file.
Ex:
D:\MyFolder contains 2 files, named file1.txt and file2.sql with 1k and 2k in size
I need to log in the following way
Name Directory Size Date
file1.txt D:\MyFolder 1024 Thu 10/10/2002
file2.sql D:\MyFolder 2048 Thu 10/10/2002

How can I write a batch file to achive this.

Thanks in advance
Regards
Ravi



Sponsored Link
Ads by Google

Response Number 1
Name: Alan
Date: October 10, 2002 at 08:11:34 Pacific
Reply:

To do this once, go to the directory containing the files you want to log information on, and create a batch file with the following commands.

DIR *.* > C:\files.log

This will cause the DIR command to pipe output into a text file named "files.log".



0

Response Number 2
Name: Ravi
Date: October 10, 2002 at 22:04:08 Pacific
Reply:

Thanks Alan,
This worked fine for me, But I have more than one directory (I mean multiple directories). But when I use the same; It is over writting the previous one. I am not finding way to append to the current file. Please give me the idea to proceed.

Thanks in advance
Regards
Ravi


0

Response Number 3
Name: frfed6008
Date: October 10, 2002 at 22:59:23 Pacific
Reply:

DIR *.* >> C:\Files.log


0

Response Number 4
Name: Ravi
Date: October 16, 2002 at 03:01:40 Pacific
Reply:

Thanks....


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: log file info to a file using batch

Re-direct ">" info to a text file WITHOUT re-creating that text file www.computing.net/answers/dos/redirect-info-to-a-text-file-without-recreating-that-text-file/2058.html

dos print to a file www.computing.net/answers/dos/dos-print-to-a-file/1263.html

Copy Files Using Batch www.computing.net/answers/dos/copy-files-using-batch/8127.html