codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » Visual Basic » Article

Visual Basic FileSystemObject Wrapper v2.5

Article by: Kenneth Ives (3/29/2003)
Bookmark us now! Add to Favourites
Email a friend!Tell a friend
Summary: DLL with several routines to make use of the Scripting.FileSystemObject. Be sure to make a reference to "Microsoft Scripting Runtime" (scrrun.dll) in your project.
Viewed: 40323 times Rating (39 votes): 
 1.5 out of 5
 Rate this Article  Read Comments  Post Comments

Visual Basic FileSystemObject Wrapper v2.5



Download now (136KB)

In this project we create a DLL with several routines to make use of the Scripting.FileSystemObject. Be sure to make a reference to "Microsoft Scripting Runtime" (scrrun.dll) in your project. To get a hard copy of the VBScript documentation or an updated version, visit:

VB Script DLL: http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/733/msdncompositedoc.xml

VBScript Documentation: http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/728/msdncompositedoc.xml

Registering FsoKci.dll

Copy the FsoKci.dll file to the system directory where all your other DLL's are stored.

  • Windows 9x, ME: \Windows\System
  • Windows NT4, 2000, XP: \Winnt\System32


Now register the DLL so it will be recognized by the system.

Select the START button, RUN

for Windows 9x, ME type: regsvr32 c:\windows\system\FsoKci.dll

for NT4, 2000, XP Type: regsvr32 c:\winnt\system32\FsoKci.dll

In the VB IDE, to use this DLL, you must first reference it via Projects, References on the toolbar menu. Scroll down the list and place a checkmark next to FsoKci

Hints and Tips

Passing a Type structure from a DLL is simple after you have done it at least once. However, this process is not well documented anywhere.

In the receiving form or module:

  1. Set up a reference to the DLL in the declarations section.

    Private cFSO as FsoKci.clsFSO

    or

    Private WithEvents cFSO as FsoKci.clsFSO
  2. Set up a reference to the Type structure located within the DLL class

    Private mtypFI as FsoKci.FileInfo
  3. Instantsiate the object.

    Set cFSO = New FsoKci.clsFSO

    Now you can reference the Type structure via mtypFI within your form or module.
  4. When you want the file information, you would first request information and then make a call to retrieve the information. Do the same for drive information.

    If cFSO.GetFileInfo("C:\Windows\Win.com") then ' The data is now the file structure Call cFSO.ReturnFileInfo(mtypFI) End If






CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'Visual Basic FileSystemObject Wrapper v2.5 '
Posted by :  Milos1 at 02:42 on Wednesday, April 27, 2005
hello author who ever you maby be im trying to find out coding for Visual Bascs 6.0. im trying to find how to make an organiser the program and im having trouble. it has been hard and every time i download a code for VB and it come up as it is an error and im not sure can u explain y?? thank-you
your sincerialy Milos MIlanovic!


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
Generate License Keys (such as CD keys on Microsoft software)
by Brian Gillham
This class allows you to generate license keys, such as the CD keys on the case of most Microsoft software
Communicating with the Database (Using ADO)
by Chaudhary Pradeep K. Roy
Using ADO to get connected with the database.
Visual Basic Read and Modify the Registry
by Kenneth Ives
Perform the four basic functions to the Windows registry. Add, change, delete, and query. Allows you to to read registry values, and modify both keys and values.
Generate an Array of Unique Random Numbers
by Brian Gillham
This function will generate an ARRAY of TRULY random numbers.
Beginning Resource Files in Visual Basic
by Kenneth Ives
Have you ever wanted to use graphics, such as icons, bitmaps, cursors, and AVI files? How about sound or even message box text? This can be an enormous amount of overhead. These are all examples of more files to keep track of when you distribute an application, DLL, or OCX. Lets find out how resource files can help....
Visual Basic Compact/Repair Access Database Utility
by Kenneth Ives
This utility will compact and repair the access database you select. It is actually more convenient to use this utility than do the same task with Access, because you don't have to save the database with a different name and then delete the old database when you are done: here, a temporary copy of the database is automatically created and deleted.
Creating a watermark in Excel with VBA
by Kenneth Ives
Adding a watermark to an Excel spreadsheet using VBA.
Change Cursor to Hour Glass
by Brian Gillham
A simple script to change the cursor to an hour glass.
Generate your own Random Numbers
by Thaha Hussain
This simple program generates random numbers using the basic mathematical methods.
Analog Clock
by Thaha Hussain
This program demonstrates Thaha Hussain's Clock Work Formula to paint an Analogue Clock.








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009