borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincani
:: Function to find if file exists

Author  

David Costelloe

Language  

VB5, VB6

Operating Systems  

Windows 95, 98 and NT
Module

Public Function FileExists(filename As String) As Boolean
    FileExists = (Dir(filename, vbNormal Or vbReadOnly Or vbHidden Or vbSystem Or vbArchive) <> "")
End Function

Usage

'Usage:
Private Sub Command1_Click()
    If FileExists("C:\Config.sys") Then
        MsgBox "Config.sys is available"
    Else
        MsgBox "Sorry Can't find Config.sys"
    End If
End Sub

:: Navigation

Home

Files and Disks Tips

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 07-05-2010 Re: How can print PDF file automatically? by elizas
icon 31-01-2010 Re: new version 1.1.0 by freddysam
icon 10-09-2009 All Running Process in Windows by SaschArt
icon 18-06-2009 Lotus - Productivity Features by Boesch25
icon 11-05-2008 Re: Calling ini file (problem with code) by Keithuk
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder