Easy vb-script question

How do I do if I want to open a file and write to it without writing over the old things in a file, e.g. how do I concatenate the new things with the old file with vb-script.
mdolandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

halapayaCommented:
you can use Filesystem object of scripting run time.

Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")

Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)

MyFile.WriteLine("This is a test.")

MyFile.Close

u can open the file with different options; like delete all and create new, or open the file with existing stuff and write to it etc..etc

check the help on FileSystemObject.
0
VbmasterCommented:
I don't know if it works in vb-script cause I have never used vb-script but here's how to do it in vb..

Dim Filenr as Integer

Filenr = FreeFile
Open filename For Append As #Filenr
Print #Filenr, "This is a test."
Close #Filenr
0
mistawallCommented:
you have to open the file as append so it would be like


Set MyFile = fso.CreateTextFile("c:\testfile.txt", 8)

not true
0
mdolandAuthor Commented:
You are wrong halapaya. I know already all the things you wrote, and to redirect me to look for the answear myself is an easy way out. I have looked through all the info I found about it at MS website.
I will give the points to mistawall
0
mistawallCommented:
okay...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.