Tracking working time with the EventLog - Programmer

This is a discussion on Tracking working time with the EventLog - Programmer ; I'd like to track the time I spent on the PC to the windows eventlog by writing an entry every 5 minutes. What is the easiest way to do that without using a C compiler? Is this possible with javascript? ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Tracking working time with the EventLog

  1. Tracking working time with the EventLog

    I'd like to track the time I spent on the PC to the windows eventlog
    by writing an entry every 5 minutes. What is the easiest way to do
    that without using a C compiler?

    Is this possible with javascript?

    Would it also be possible to hook into the screensaver api and track
    the idle time?

    Are there already programs doing that?

    Thanks for your help,
    JMS

    fup2 comp.os.ms-windows.programmer.misc


  2. Re: Tracking working time with the EventLog

    "J M Schlatter" wrote in message
    news:vImTVl25inkn-pn2-crLIGI9HLeGu@jms.xww.de...
    > I'd like to track the time I spent on the PC to the windows eventlog
    > by writing an entry every 5 minutes. What is the easiest way to do
    > that without using a C compiler?
    >
    > Is this possible with javascript?
    >
    > Would it also be possible to hook into the screensaver api and track
    > the idle time?
    >
    > Are there already programs doing that?
    >
    > Thanks for your help,
    > JMS
    >
    > fup2 comp.os.ms-windows.programmer.misc


    Following-up from the crosspost in microsoft.public.scripting.jscript,
    JScript supports appending to the eventlog:

    From the Windows Script (WSH) Docs:


    The LogEvent method returns a Boolean value (true if the event is logged
    successfully, otherwise false). In Windows NT/2000, events are logged in
    the Windows NT Event Log. In Windows 9x/Me, events are logged in WSH.log
    (located in the Windows directory). There are six event types.

    Type Value
    0 SUCCESS
    1 ERROR
    2 WARNING
    4 INFORMATION
    8 AUDIT_SUCCESS
    16 AUDIT_FAILURE




    var WshShell = WScript.CreateObject("WScript.Shell");
    var rc = runLoginScript();

    if (rc)
    WshShell.LogEvent(0, "Logon Script Completed Successfully");
    else
    WshShell.LogEvent(1, "Logon Script failed");


    You could write a simple cscript to do this.

    NB: I won't be monitoring the thread in
    comp.os.ms-windows.programmer.misc, but I've re-attached
    microsoft.public.scripting.jscript
    --
    Andrew Urquhart
    Reply: www.andrewu.co.uk/about/contact/



  3. Re: Tracking working time with the EventLog

    >
    > var WshShell = WScript.CreateObject("WScript.Shell");
    > var rc = runLoginScript();
    >
    > if (rc)
    > WshShell.LogEvent(0, "Logon Script Completed Successfully");
    > else
    > WshShell.LogEvent(1, "Logon Script failed");
    >


    Thank you very much!

    JMS


+ Reply to Thread