Writing a text file from within a script only if a candition is th

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I've write a VB script that retrive all error events from Event Logs on the
local machine (by Win32_NTLogEvent) and write it to an output text file.
The script is scheduled to run every day at a specified time and retrive
only events occurred in the previous 24 hours.
Actually it open and write the output text file always, even if no error
events logs occurred (in this case the output text file is, obviously, empty).
The question is:
is there a way to open and write the output text file only if it is no empty
(if an error occurred) and in wich mode?
In this way, in fact, every day I'll check the local machine and only if
there was errors in the event logs in the previous day I'll find the output
text file without the needs to check and read an empty output text file.
Thanks in advance.
Cosimo MERCURO

.



Relevant Pages

  • Re: Writing a text file from within a script only if a candition is th
    ... Show us your script, and we can probably show you were to add an If/Then ... > I've write a VB script that retrive all error events from Event Logs on ... > local machine and write it to an output text file. ... > empty). ...
    (microsoft.public.scripting.vbscript)
  • Win2k Security Log Scripting Context Issues
    ... I wrote a script to dump the past ... 24hr event logs into a delimited file. ... I've gone into the Local Security Policy and made the change to allow ... App and System logs work ...
    (microsoft.public.scripting.vbscript)
  • Re: Strange error when Exporting eventlogs to a csv file
    ... Anyone have an idea for an alternative code with which I can export ... >> which exports yesterdays events from all local event logs to an csv ... When I run the script to export the ...
    (microsoft.public.scripting.vbscript)
  • Re: Strange error when Exporting eventlogs to a csv file
    ... > Anyone have an idea for an alternative code with which I can export ... >>> which exports yesterdays events from all local event logs to an csv ... When I run the script to export the ...
    (microsoft.public.scripting.vbscript)
  • Re: Strange error when Exporting eventlogs to a csv file
    ... Xander wrote: ... > internet) which exports yesterdays events from all local event logs ... When I run the script to export from ...
    (microsoft.public.scripting.vbscript)