After searching through the group and a little tinkering, I came up with this that allows you to create a file with the date. The format is such as it will be easier to find in a folder later YYMMDD.
Hope this helps someone! Thanks to those who helped me.
Dim fsoObject, open_File, target_File, thisday
Set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")
' ********* Main processing section **********
' ### call function to get the date ###
today_date()
' ### set the file name to include the variable from the process above
target_File = "C:\temp\vb\" & thisday & ".txt"
' ### open the file and put a header on the page ###
Open_My_File()
open_File.WriteLine "*******************************************"
open_File.WriteLine "* Daily Checks for: " & date & ". *"
open_File.WriteLine "* Run at: " & time & ". *"
open_File.WriteLine "* This file is named: " & thisday & ".txt *"
open_File.writeline "*******************************************"
open_File.WriteLine " "
Close_my_File()
' *********** Procedures go here *************
' ### This function opens a file ###
Function Open_My_File()
If (fsoObject.FileExists(target_File)) Then
Set open_File = fsoObject.OpenTextFile(target_File, 8)
Else
Set open_File = fsoObject.OpenTextFile(target_File, 2, "True")
End If
End Function
' ***************************************************************
' ***************************************************************
' ### This function closes a file ###
Function Close_My_File()
open_File.Close()
End Function
' ***************************************************************
' ***************************************************************
' ### This funtion gets the date in format yymmdd ###
Function Today_Date()
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.