Skip to content

Instantly share code, notes, and snippets.

@yukioc
Created August 17, 2012 15:10
Show Gist options
  • Save yukioc/3379701 to your computer and use it in GitHub Desktop.
Save yukioc/3379701 to your computer and use it in GitHub Desktop.
write time and comment to log file for recording a login or logout time.
var a=WScript.arguments;
var f=WScript.CreateObject("Scripting.FileSystemObject");
var d=(new Date()).toLocaleString();
var c=(a.length>0)?a(0):"";
var n=WScript.ScriptFullName.replace(/\.\w+/,".txt");
var t=f.OpenTextFile(n,8,true);
t.WriteLine( d+" "+c );
t.Close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment