Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi:
I want to write a batch file so that the following info is put into a text file:user name
computer name
log in dateas each new user logs onto my network, the above info is put into the text file so that it starts to look like this:
jimmy,7890,9/05/01
mary,2343,9/6/01
etc.try as i might, i can't get the date part of this batch file to work. the user name and computer name work fine. it might just not be doable, but if anyone has any ideas, i'd be most appreciative.
tia,
cherub

You might try using EDLIN to create an ASCII text file with one line consisting solely of a carriage-return/linefeed. I'll call this file CRLF.TXT.
For example, enter:#>edlin crlf.txt
*i1
1*
2*
*e
#>Now add the appropriate DATE entry in the batch file where you want it to execute, redirecting the command's standard input from the text file, and appending it's output to your log file. For example, a line might read:
DATE > LOGIN.TXT
But this would leave you with more than the date, like fields "Current date is" and "Enter new date:" or something like that, but I can't think of a cleaner way right now.
I'm on someone's else's machine and can't get to the prompt, so let me know if it works...

Sorry!!! Thanks to this forum's formatting of text what I typed came out differently and all wrong!
First off, the part about edlin could read more:
1* (Just press the Enter key)
2* (Press Ctrl-Z, followed by Enter)And another line should read (this is one command-line):
DATE (Here goes the less than (left) arrow) CRLF.TXT (Here go two greater-than (right) arrows) LOGINS.TXT

![]() |
dos question
|
Search in variables
|

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