tags:

views:

17

answers:

1

hi all

what’s wrong on the following syntax I want to verify if file.vb exist under currDir (currDir=C:\dir1\dir2)

If (fso.FileExists(currDir\file.vb)) Then

Wscript.Echo OK

End If

A: 

Missing double quotes and concatenation operator &:

Set fso = CreateObject("Scripting.FileSystemObject")
currDir="C:\dir1\dir2"

If (fso.FileExists(currDir & "\file.vb")) Then
  Wscript.Echo OK
End If 
Sarfraz