Computing.Net > Forums > Disk Operating System > User log in date from a batch file

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.

User log in date from a batch file

Reply to Message Icon

Name: cherub
Date: September 7, 2001 at 06:35:35 Pacific
Comment:

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 date

as 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




Sponsored Link
Ads by Google

Response Number 1
Name: ooh la la
Date: September 7, 2001 at 11:28:12 Pacific
Reply:

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...



0

Response Number 2
Name: me again
Date: September 7, 2001 at 11:34:11 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


dos question Search in variables



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: User log in date from a batch file

Display date from a batch file www.computing.net/answers/dos/display-date-from-a-batch-file/2143.html

reading a file from a batch file www.computing.net/answers/dos/reading-a-file-from-a-batch-file/765.html

Detect directory from a batch file.. www.computing.net/answers/dos/detect-directory-from-a-batch-file/4010.html