![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 18
Rep Power: 0
![]() |
FileSystemObject
Hello All, I was wondering if someone could help explain this piece of VB code to me? I've read about the FileSystemObject online but the 'rfs' function is a bit confusing. Any help is appreciated.
Thanks Function rfs(filespec)
Dim fso, Msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
Msg = "YES"
Else
Msg = "NO"
End If
rfs = Msg
End Function |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Apr 2005
Posts: 18
Rep Power: 0
![]() |
Re: FileSystemObject
Actually, I understand that the rfs function is taking in say, a string like for example C:Windows\Notepad.exe"and it's checking if that file exists...just not sure about the
Set fso = CreateObject("Scripting.FileSystemObject")Hmm... |
|
|
|
|
|
#3 |
|
12 years old
Join Date: Nov 2007
Posts: 105
Rep Power: 0
![]() |
Re: FileSystemObject
Scripting.FileSystemObject is an activex control object, and the function returns whether or not the argument filespec exists.
it should be (i believe): Function rfs(ByVal filespec As String) As String
Dim fso, Msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
Msg = "YES"
Else
Msg = "NO"
End If
rfs = Msg
End Function |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|