FileSystemObject

I'm new to VB.  I've been writing VBScripting for a few however.  My question is what component do I add to my project to be able to use the FileSystemObject?
LVL 5
raizonAsked:
Who is Participating?
 
JonFish85Connect With a Mentor Commented:
Project -> References -> Microsoft Scripting Runtime


hope this helps!
0
 
JonFish85Commented:
Then use something like this:

Dim fs As New FileSystemObject

'code here

set fs = nothing
0
 
JonFish85Commented:
alternativly you can go:

Dim fs As Object

Set fs = CreateObject("Scripting.FileSystemObject")
'Stuff
Set fs = Nothing

but this is using "late binding" which is slower... Microsoft suggests using early binding, as in example above...
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
raizonAuthor Commented:
Great.  Thats exactly what I needed.  I had the early binding set.  Which I'm glad that you posted that cause it confirmed that I was doing it correctly.

Thanks again
0
 
JonFish85Commented:
glad to be of service!
0
 
raizonAuthor Commented:
Good luck on your MCSD.  

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.