Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

VB Script: log file withtout using appending mode.

Hello experts,

I was wondering how can I clean the following:

' Text file I/O constants
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

' Reset log file
If  objFSO.FileExists(strLogFile) Then
   objFSO.DeleteFile strLogFile
End If

' Define log variable
Set objLog = objFSO.OpenTextFile(strLogFile, ForAppending, True)

Open in new window


Instead of appending all the actions in a log file I would like to reset it every time when I launch the script instead of using the Delete file action. Otherwise the file get bigger and I can have potentially a problem of disk space.

Thank you again for help.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Sorry for the delay I will test it tomorrow.
I tested and it works.

Thank you very much for your help.