-
Newbee Question
I currently program in VB and need to do some VBS. The major question is opening and writing files. In VB I have to use an OPEN statement, but in VBS all it seems you have to do is the following:
Set logfile = FSO.OpenTextFile("\\myDrive\reskit$\logpw.txt", 8, 0)
logfile.Write Date & "," & Time & "," & localMach & ",PW change 2 failure" & vbNewLine
logfile.Close
Is the Set command opening the file or just reserving the file name? I need to have several computer writing to this log file at a time.
Thanks for the information.
Jim
-
The OpenTextFile returns a textstream object
You assign an object to an object variable
with the Set statement:
Set variable = object
-
DeadEyes,
Thank you for the information. One more question. When is the file actually OPEN for writing. Under VB, the file is open with the "OPEN filename AS OUTPUT". Is this the same for VBS or it only opens the file when you do the myfilename.write?
Thanks again.
Jim