I've come into a position where all the existing scheduled applications write their logs to .CSV files, so that people can open them in Excel. The problem comes when someone opens a log file and just leaves it open. The applications then can't write to their logs, and by rule, they die.
So the options are:
Or am I just missing a totally brainless way to deal with this?
Most of the apps are currently VBScript, but I've already managed to convert many of them to C# console apps, so answers in both styles are welcome.
If you set NTFS permissions on the folder containing the CSV files appropriately so that your users only have read access whilst the user your scheduled tasks are running as has full access, then Excel will open the files in Read Only mode.
This will prevent Excel from holding a lock on the files and allow your logging to continue unhindered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With