Wednesday, 19 October 2011

QTP Script: Check to see if a local or network file exists


' =============================================================
' function: CheckFileExists
' desc : Checks to see if a file exists
' params : strFile - full path of the file to find
' returns : True if file exists, False otherwise
' =============================================================

Function CheckFileExists(strFile)

 

Dim objFS

 

' create a file system object
Set objFS = CreateObject("Scripting.FileSystemObject")

 

' check that the source file exists
If objFS.FileExists(strFile) Then

 

    ' file exists, return true
    CheckFileExists = True

Else 

    
' file exists, return false
    CheckFileExists = False

End If

End Function 'CheckFileExists


8 comments:

  1. I don't even know the way I stopped up right here, but
    I thought this put up was great. I don't recognize who
    you might be but definitely you're going to a well-known blogger
    if you are not already. Cheers!

    Have a look at my site; minecraft.net

    ReplyDelete
  2. Undeniably believe that which you stated. Your favorite justification appeared to be on the
    web the easiest thing to be aware of. I say to you, I definitely get irked while people consider worries that they plainly don't know
    about. You managed to hit the nail upon the top as well as
    defined out the whole thing without having side effect , people
    can take a signal. Will probably be back to get
    more. Thanks

    Feel free to visit my site quest bars

    ReplyDelete
  3. Hi, after reading this amazing article i am as well happy to share my knowledge here with
    colleagues.

    Take a look at my web site - Quest bars

    ReplyDelete
  4. What's Going down i'm new to this, I stumbled upon this I have
    discovered It positively useful and it has helped me out loads.
    I hope to give a contribution & assist other customers like its helped me.
    Great job.

    Feel free to surf to my web page quest nutrition bars

    ReplyDelete
  5. Paragraph writing is also a fun, if you be familiar with afterward you
    can write or else it is difficult to write. Quest Bars blogesaurus

    ReplyDelete
  6. excellent points altogether, you simply won a new reader.
    What would you suggest about your publish that you made a few days ago?
    Any certain?

    Also visit my web-site :: diet Plans for women

    ReplyDelete
  7. I have to thank you for the efforts you have put in penning this site.

    I really hope to see the same high-grade content by you later on as well.
    In truth, your creative writing abilities has motivated me to get my
    very own site now ;)

    Here is my page - Lose Weight for Women

    ReplyDelete
  8. Having read this I thought it was really informative.
    I appreciate you spending some time and energy to put this informative
    article together. I once again find myself spending a lot of time
    both reading and commenting. But so what, it was still worthwhile!


    My web-site coconut oil hair

    ReplyDelete