There are a few things you could do here to make this easier. For one, rather than make a batch file+script for each instrument's software, you could just make a single wrapper which would take the instrument as a parameter, do the logging and then look up the correct software to call (from a hash, for example, or a database if you have already invested in that infrastructure).

You could also write plain batch file wrappers (or again, a single wrapper) which dump the user/study/instrument/start-time to a single log and then build a perl script to parse through that file. To get end times, I'd just have the wrapper batch file make a log entry before and after the instrument code runs. You could even ftp these logs to a central server where your perl script could do the parsing, meaning you'd only have to maintain one instance of perl, if that's an issue.


In reply to Re: Automating program use logging on Win32 by chaos_cat
in thread Automating program use logging on Win32 by c4onastick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.