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
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
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
Summary: Greetings, I'm trying to write a text batch file for NT that tracks user logins by creating a file called %username% evertime a user logs in. I then re-direct ">" that info to a .txt file as a psuedo ...
Summary: Hi I don't use DOS much now, mostly Win 98. I do have a program that requires DOS, it runs fine under WIN98 DOS. This program allows me to print files but wont allow me to print to a file. Is there...
Summary: I seldom use batch files and know little about them, but in case no one else gives you a better approach do like you would on the command line. (You do not have to type the patch file each time ...