Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
PLease help me in developing many text files which should contain some text in it using vbscript and those text file names should be unique. ie: GUID should be for file name.

I have developed a vbfile to create a single text file

The code goes here...
VB
DIM fso, writeFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set writeFile = fso.CreateTextFile("E:\Revathi\VBScript\newtextfile.txt", True)
writeFile.Write(""Welcome to flexorbits".")
writeFile.Close
Posted

1 solution

Dim counter AS BigInt
Dim Limit AS BigInt
DIM fso, writeFile
DIM file_Name as String
Limit=1000
Do Until counter<>Limit
file_Name="E:\Revathi\VBScript\newtextfile" & counter & ".txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set writeFile = fso.CreateTextFile(file_Name, True)
writeFile.Write("Welcome to flexorbits.")
writeFile.Close
SET fso = NOTHING
counter=counter+1
Loop
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900