Question:
How can I create a script that checks whether a certain file exists in a specific folder?
Solution:
To do so, you can use a script similar to the following:
Set fso = CreateObject(“Scripting.FileSystemObject”)
If fso.FileExists(“C:\file.txt”) Then
MsgBox “This file already exists!”
Else
MsgBox “File not found!”
End If
If fso.FileExists(“C:\file.txt”) Then
MsgBox “This file already exists!”
Else
MsgBox “File not found!”
End If