Skip to content

Instantly share code, notes, and snippets.

@bash0C7
Created January 2, 2012 00:15
Show Gist options
  • Save bash0C7/1548748 to your computer and use it in GitHub Desktop.
Save bash0C7/1548748 to your computer and use it in GitHub Desktop.
WorkLogger.vbs
'1 line ver
CreateObject("Scripting.FileSystemObject").OpenTextFile(CreateObject("Scripting.FileSystemObject").BuildPath(CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName), "worklog_" & WScript.CreateObject("WScript.Network").ComputerName & ".txt"), 8, True).WriteLine date & vbtab & time & vbTab & InputBox("Comment", WScript.ScriptName)
'3 line ver
With CreateObject("Scripting.FileSystemObject")
.OpenTextFile(.BuildPath(.GetParentFolderName(WScript.ScriptFullName), "worklog_" & WScript.CreateObject("WScript.Network").ComputerName & ".txt"), 8, True).WriteLine date & vbtab & time & vbTab & InputBox("Comment", WScript.ScriptName)
End With
'4 line (basic)
With CreateObject("Scripting.FileSystemObject")
With .OpenTextFile(.BuildPath(.GetParentFolderName(WScript.ScriptFullName), "worklog_" & WScript.CreateObject("WScript.Network").ComputerName & ".txt"), 8, True)
.WriteLine date & vbtab & time & vbTab & InputBox("Comment", WScript.ScriptName)
.Close
End With
End With
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment