Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

I have a line in our logon script which is really useful.

 

It is:

 

echo %date%,%time%,%username%,%computername%,%logonserver% >> \\Fp4\ShApps\pcaudit\logonlist2.csv

 

This then creates a log which we can refer to in disputes! and also we can use it to see how often certain PC's are actually being used.

 

The problem I have is with the %time% variable once I open the CSV in excel (or other).

 

Some show as:

 

9:54:37.48 = which I take to mean 9.54am

There are also a few which start with an 8, such as:

8:07:30.03 = which I take to mean 8.07pm

 

However the majority are shown with less figures:

Ranging from:

00:00:08 to 00:59:40

 

So I can little confused how the %time% variable relates to the real time....

 

Anyone shed any light on this?

Posted

I've been able to solve it by renaming the file as a TXT file and then importing in to Excel - otherwise it loses the formatting somehow.

 

Also some times have less details:

 

7:01:31.87 v 11:29

 

So in excel I've been able to use a similar command to : =LEFT(F9,LEN(F9)-9) to get all times the same.

 

I wonder if some PC's return the %time% variable differently or if certain times are reported differently - bit weird.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...