Results 1 to 3 of 3

Thread: Newbee Question

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    41

    Question 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

  2. #2
    DeadEyes
    Guest
    The OpenTextFile returns a textstream object
    You assign an object to an object variable
    with the Set statement:

    Set variable = object

  3. #3

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    41
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width