I am trying to do a simple check of whether or not a file exists in VB Script. My attempts have failed because of the limited functionality of VB Script vs. Visual Basic.<br>I need help.
To check if a file exists or not use FileExists from the FileSystemObject of VBS. It returns a boolean result indicating whether the requested file is there or not. See the example below.<br><br> Set FSys = CreateObject("Scripting.FileSystemObject"<br> if Not FSys.FileExists("C:\Filename.txt" Then<br> ...<br><br>You may also be interested in the VBS documentation, available to download as an exe from the Microsoft site. Its called vbsdoc.exe and has a good tutorial on the FileSystem Object.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.