dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How to reference the filesystemobject

  1. #1
    Join Date
    Sep 2001
    Posts
    27

    How to reference the filesystemobject


    Dear Gurus,

    I'm trying to replace my Dir, FileCopy and Kill statements with the FileSystemObject.
    HOWEVER, my VB6 doesn't seem to know about this.
    Anyone can tell me wich reference I use?

    When I type: Dim fso as Files.... itīs not autocompleted, know what I mean?

    Grzzz & thanx, Braniac.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: How to reference the filesystemobject

    'early binding
    Dim oFileSystem As New Scripting.FileSystemObject
    'or late-bind with: ('Reference "Microsoft Scripting Runtime" (scrrun.dll) available at http://www.microsoft.com/scripting)
    Dim oFileSystem As Object
    Set oFileSystem = CreateObject("Scripting.FileSystemObject")


    Iouri Boutchkine
    iouri@hotsheet.com
    Iouri Boutchkine
    iouri@hotsheet.NOSPAM.com

  3. #3
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: How to reference the filesystemobject

    The FileSystemObject is in SCRRUN.DLL... you'll have to set a reference to this file (ie. Project-> References) look for "Microsoft Scripting Runtime" in the list. If it isn't there, use the browse button to locate it in the Windows\system directory.


  4. #4
    Join Date
    Sep 2001
    Posts
    27

    Re: How to reference the filesystemobject

    Thanx guys, that's right on the spot!!!


Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)