by Bhuwan Chand Joshi (69 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Checking the presence of file in your system
'Make a reference to a Microsoft Scripting Runtime Library
Public sub Form_Load()
Dim fso As New FileSystemObject
If fso.FileExists("D:\test.txt") Then
MsgBox "File Exist", vbInformation
Else
MsgBox "File not exist", vbInformation
End If
End Sub
'This program checks whether the file test.txt exists in the "D:" drive