khensonm
01-29-2001, 03:01 PM
Hello! I am running Win95 on a Dell laptop. What I am trying to do is automatically limit the amount of time my 13-yr-old son spends on AIM (AOL Instant Messenger). Obviously the traditional "Son, your time is up -- got off the machine" approaches are not working, as I don't return home from work until quite late and there is very little way to enforce timings. The boy is starting to live inside the computer, so I am trying to limit him so that he is forced to go outside and play basketball with the neighbours' kids, etc. His science teacher requires that they use the Internet almost every night, so removing the machine or disconnecting the cable modem isn't the answer.
I was a UNIX sys admin and wrote a lot of cron jobs, wrappers, and backends, but am not that familiar with Win95. I envision writing a wrapper for AIM that looks something like this:
- erase any old dummy file (see next step)
- create a dummy file (basically just a file with a date -- something like UNIX does with "touch") to give an indication when AIM started
- run AIM
Then, a task would run every 15 mins or so at bootup, checking if this dummy file exists. If yes, somehow keep track of the time that AIM is running based on the dummy file timestamp and, after TIME X, start giving warning messages. At TIME Y, shut down AIM if it is still running.
I would also need to make sure that he doesn't just kill AIM and restart it. What I need help with (as far as I can tell) is:
- how to check for the existence and timestamp of a file
- how to check if a process is running
- how to kill a process (is there a "kill -9" equivalent?)
Obviously I am thinking like a UNIX person, and am probably making this more difficult than it is. Any suggestions would be greatly appreciated.
I was a UNIX sys admin and wrote a lot of cron jobs, wrappers, and backends, but am not that familiar with Win95. I envision writing a wrapper for AIM that looks something like this:
- erase any old dummy file (see next step)
- create a dummy file (basically just a file with a date -- something like UNIX does with "touch") to give an indication when AIM started
- run AIM
Then, a task would run every 15 mins or so at bootup, checking if this dummy file exists. If yes, somehow keep track of the time that AIM is running based on the dummy file timestamp and, after TIME X, start giving warning messages. At TIME Y, shut down AIM if it is still running.
I would also need to make sure that he doesn't just kill AIM and restart it. What I need help with (as far as I can tell) is:
- how to check for the existence and timestamp of a file
- how to check if a process is running
- how to kill a process (is there a "kill -9" equivalent?)
Obviously I am thinking like a UNIX person, and am probably making this more difficult than it is. Any suggestions would be greatly appreciated.