Luis Diaz
asked on
VB Script: log file withtout using appending mode.
Hello experts,
I was wondering how can I clean the following:
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.
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)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tested and it works.
Thank you very much for your help.
Thank you very much for your help.
ASKER