Hi,
I want to make a script that checks that all the required files are where before starting the application.
I was to write something like:
If App.Path & "\config.ini" does not exist THEN
MsgBox "Error"
End If
Any ideas?
Thanks!
Printable View
Hi,
I want to make a script that checks that all the required files are where before starting the application.
I was to write something like:
If App.Path & "\config.ini" does not exist THEN
MsgBox "Error"
End If
Any ideas?
Thanks!
You mean something like this?
VB Code:
Private Sub Command1_Click() On Error GoTo ErrH Open "c:\anyfile.txt" For Input As #1 'Anything here Close #1 Exit Sub ErrH: If Err.Number = 53 Then MsgBox "File not found!" End Sub
Thanks alot!
You can check the file's existance using the Dir() command...the example would beVB Code:
If Dir(App.Path & "\config.ini", vbNormal) = "" Then MsgBox "File does not Exists" End If