TechTutorials - Free Computer Tutorials  







VBScript - How to Save a File With Today's Date as the Filename Hot Popular
 


Added: 12/13/2005, Hits: 13,598, Rating: 5, Comments: 1, Votes: 1
Add To Favorites | Comment on this article
This is a little VBScript that will create a file with the system date as the file name. I am going to use this script to create a logfile each time I run a daily scheduled task.....

Code :

Varnow = now
vardate = Day(varnow) & "-" & Month(varnow) & "-" & Year(varnow) & ".log"

LogPath = ("C:\MY Logs\" & VarDate)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(LogPath)


Enjoy!





Comments (1)

Review By: qasameer [11/19/2013]
Review Text: it's excellent article and very much simple to understand and implement. Regards, Sameer.chivate@gmail.com

Items Per Page:



Related Items








7 Seconds Resources, Inc.




IT Showcase