Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a file every month 1

Status
Not open for further replies.

vbscript11

IS-IT--Management
Nov 15, 2010
4
IN
Hi Experts,

Please help me out with a VB Script to create a file every month.

Thanks in advance
Sujith
 
Hi all,

Actually we are appending a text file whenever the script runs.But we want to create a new text file every month and append to that text file.ow this can be done.
Please help.
Thanks
 
Actually we are appending a text file
Why not posting your actual code doing that ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Here an example:
Code:
   Const ForReading = 1, ForWriting = 2, ForAppending = 8
   Dim fso, strPath, f
   strPath = "c:\testfile" & (100*Year(Now)+Month(Now)) & ".txt"
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile(strPath, ForAppending, True)
   f.Write "Hello world! " & Now
   f.Close

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top