Hello,
I want to add some logging into an existing script. The code here works but I was wondering if there is a way to have it create the *.log file on a subdir from where the script is getting run from. then I do not have to code the full path to the log file.
Right now when I run this code it will create a log foleder and file under my user profile name.
Any hints on where to look would be appreciated. Or any suggestion in the existing code as well.
Const ForAppending = 8
Dim strLogFile, strDate
strDate = Date
strLogFile = "Logs\Find_Primary_" & Year(strDate) & Month(strDate) & Day(strDate) & ".log"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("testingthis.log", ForAppending, True)
objLogFile.WriteBlankLines(2)
objLogfile.WriteLine "Testing my new log file"
objLogFile.Close
I want to add some logging into an existing script. The code here works but I was wondering if there is a way to have it create the *.log file on a subdir from where the script is getting run from. then I do not have to code the full path to the log file.
Right now when I run this code it will create a log foleder and file under my user profile name.
Any hints on where to look would be appreciated. Or any suggestion in the existing code as well.
Const ForAppending = 8
Dim strLogFile, strDate
strDate = Date
strLogFile = "Logs\Find_Primary_" & Year(strDate) & Month(strDate) & Day(strDate) & ".log"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("testingthis.log", ForAppending, True)
objLogFile.WriteBlankLines(2)
objLogfile.WriteLine "Testing my new log file"
objLogFile.Close