+ Post New Thread
Results 1 to 6 of 6
Windows Thread, log-on Logs Script in Technical; I wonder if anyone can help. I have created the following log on script, that creates two text files in ...
  1. #1

    Join Date
    Oct 2010
    Posts
    66
    Thank Post
    36
    Thanked 1 Time in 1 Post
    Rep Power
    0

    log-on Logs Script

    I wonder if anyone can help. I have created the following log on script, that creates two text files in separate folders for each and every each time a student logs on. One text file named with the computer name, one with the user name. The details within text files are the same . The reason for two files is so I can search by user or computer. My one issue with the script is that with the Compute named text files do not append a new entry if the computer is logged onto a second time, unless the PC is restarted in between, although the user text file appends perfectly for each and every user even if they log off , back on the same PC WITHOUT restarting, ie two entries in User A text file but only one in computer A text file. Does anybody know why this would be as it's the same info just being sent to different locations.

    echo Log In %Date% %TIME% %USERNAME% >> \\servername\Computerlogon\%COMPUTERNAME%.log
    echo Log In %Date% %TIME% %COMPUTERNAME% >> \\servername\Studentlogon\%USERNAME%.log

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,824
    Thank Post
    372
    Thanked 544 Times in 507 Posts
    Rep Power
    184
    Do the users have access to edit another persons text file?

    As in the username would be created by themselves so owned.
    The computer one might be created by bob, and being editted by Jim

    Steve

  3. #3

    Join Date
    Oct 2010
    Posts
    66
    Thank Post
    36
    Thanked 1 Time in 1 Post
    Rep Power
    0
    No. This is what happens. User A logs on to Computer A script creates text files called userA and Computer A with the date /time /name entries. When User A logs on elsewhere it appends to the already created User A text file. User B comes along logs onto Computer A that has NOT been restarted, User B file is created but no entry added to Computer A file UNLESS it has been restarted, I can't see why.

  4. #4

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,824
    Thank Post
    372
    Thanked 544 Times in 507 Posts
    Rep Power
    184
    Which is why I was saying about edit permissions etc. If you do it this:

    echo Log In %Date% %TIME% %USERNAME% >> \\servername\Computerlogon\%COMPUTERNAME%%TIME%.lo g
    echo Log In %Date% %TIME% %COMPUTERNAME% >> \\servername\Studentlogon\%USERNAME%.log
    Just to test and see if it creates two seperate files, then its to do with editting another persons file. If it still wont create it ignore me!

    Steve

  5. #5

    Join Date
    Oct 2010
    Posts
    66
    Thank Post
    36
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Maybe I'm misunderstanding you. All the user files create fine and append fine. The Computer files also create fine but will only APPEND fine if restarted inbetween logins.
    ie at the end of the day if a PC has not been restarted it will only show one user for the whole day (ie the first user), even though I can see through the various user files it has been logged onto many times yet if userA logs on twenty times EVEN to the SAME computer without restarts it will append all 20 in the user file but the computer file will only show 1 entry.

  6. #6

    Join Date
    Oct 2010
    Posts
    66
    Thank Post
    36
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Yes I think it is a permissions issue......thanks.



SHARE:
+ Post New Thread

Similar Threads

  1. Track log on, log off times
    By RichB in forum Windows
    Replies: 6
    Last Post: 16th May 2013, 04:11 PM
  2. Verbose logging on startup script
    By InspireICT in forum How do you do....it?
    Replies: 4
    Last Post: 8th July 2011, 09:05 AM
  3. Replies: 15
    Last Post: 24th November 2009, 12:17 PM
  4. Replies: 9
    Last Post: 10th May 2007, 11:13 AM
  5. Replies: 3
    Last Post: 23rd March 2007, 10:36 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •