Well, basically there no FileDoesNotExit() function, if that's what you're asking. What you can do is ask it this way:
If Not objFSO.FileExists(strFile)
Main Topics
Browse All TopicsI need to write a script to verify that a file does not exist. I know that the FileExists method is used to verify if a file exists, but is there an opposite method? Here's what I'm doing. I'm creating a startup script to create a folder on local PCs and then copy a file from the network to the folder. Before it does any of this, I want the script to verify first whether the file exists or not, then if the file doesn't exist it should check to see if the folder exists, if the folder exists it should check to see if the file is in there. If it is, then nothing should occur, if it isn't, then it should copy the file from the network. If neither the folder or file exist it should first create the folder and then copy the file from the network. Here's what I have so far but my code isn't entirely right because the else if statement only checks to see if the folder exists. If the folder exists but the file doesn't, it won't copy the file. Basically, I just don't want to generate unnecessary network traffic everyday copying a file to a PC if the file already exists on the PC. Please help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you only want to do anything if it doesn't exist, regardless if it existing already, you can use vbscript "Not" operator as I should you before. This way...
If file does not exist, FileExists will return false and, by using Not before the FileExists function, you will be denying its result, so you'll get (Not False) = True, which will do the trick.
Business Accounts
Answer for Membership
by: matthewspatrickPosted on 2008-05-13 at 06:08:40ID: 21554631
FileExists returns True or False...
If objFSO.FileExists(...) Then
'code if it exists
Else
'code if it doesn't exist
End If