|
Answer» I TRIED to read up on some of the more current threads before posting this, but didn't see anything similar enough. I'm new at a job and inherited this issue (so I'm not even sure it's the best method for achieving this goal).
There are two batch files:
First: echo Logon %COMPUTERNAME%,%USERNAME%,%DATE%,%TIME% >> \\server\logon$\UserLogon.csv
Second: echo Logoff %COMPUTERNAME%,%USERNAME%,%DATE%,%TIME% >> \\server\logon$\UserLogon.csv
Issue: The file is opened in EXCEL and the Time column is convered to time. The values are different. Logon formats as "9:02:44.06" and Logoff formats as "12:47:06 AM" I need to subtrack the times so they need to be in the same format.
Perhaps this is an Excel issue, and not a batch issue, but is there any modifications I can make to the script to get the data to format consistently? Also, is there anyway to capture the INFORMATION with a single batch file, or to get teh difference in logon and logoff time automatically?
Thanks in advance.No need since you are IMPORTING into Excel. Excel should take care of the formatting for you automatically so you just need to subtract the times.I believe the information from the .cvs file was imported into Excel and that a time format applied to those values. Instead of using a formatting option which took into account the AM/PM information, it APPEARS to have been formated into a simple hh:mm:ss. This information was then saved, which overwrote the raw data. Additional data is then appended to the end of the file and process starts all over again.
I think I just need to go back and start from scratch, applying the correct time format to the data.
Thanks.
|