2***@gmail.com
2015-03-17 12:23:46 UTC
Hello,
i have this script:
Sub WriteLogFile(SLogFileLine)
dateStamp = Now()
strFileOutput = "C:\temp\log\status.csv"
Set objFsoLog = CreateObject("Scripting.FileSystemObject")
'Check if file exists
if objFsoLog.FileExists(strFileOutput) Then
Set logOutput = objFsoLog.OpenTextFile(strFileOutput, 8, True)
Else
set logOutput = ObjFsoLog.CreateTextFile(cstr(strFileOutput))
End if
'Write Date/Timestamp + Computername + Event in the logfile
logOutput.WriteLine(cstr(dateStamp) + "," + SLogFileLine + ",")
logOutput.Close
Set logOutput = Nothing
Set objFsoLog = Nothing
End Sub
WriteLogFile("sda")
When i call it, it works!
But i want to call it like:
client = "PC123"
WriteLogFile(client)
But when i call it like this, i get only the timestamp + comma. And nothing of the content from the string "client".
What am i doing wrong?
i have this script:
Sub WriteLogFile(SLogFileLine)
dateStamp = Now()
strFileOutput = "C:\temp\log\status.csv"
Set objFsoLog = CreateObject("Scripting.FileSystemObject")
'Check if file exists
if objFsoLog.FileExists(strFileOutput) Then
Set logOutput = objFsoLog.OpenTextFile(strFileOutput, 8, True)
Else
set logOutput = ObjFsoLog.CreateTextFile(cstr(strFileOutput))
End if
'Write Date/Timestamp + Computername + Event in the logfile
logOutput.WriteLine(cstr(dateStamp) + "," + SLogFileLine + ",")
logOutput.Close
Set logOutput = Nothing
Set objFsoLog = Nothing
End Sub
WriteLogFile("sda")
When i call it, it works!
But i want to call it like:
client = "PC123"
WriteLogFile(client)
But when i call it like this, i get only the timestamp + comma. And nothing of the content from the string "client".
What am i doing wrong?