Jump to content

wkboarder348

Member
  • Posts

    3
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts posted by wkboarder348

  1. That sorta works. It stops at the first space and the reason i know it does is because if the setup is there i run it, and if it isn't there it still trys to run it.. so whether the file is there or not, that way always returns true

    You shouldn't need any quotes. Try this:

    Dim filespec, msg
    filespec = "E:\Program Files\Internet Explorer\iexplore.exe"
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FileExists(filespec)) Then
    msg = filespec & " exists."
    Else
    msg = filespec & " doesn't exist."
    End If
    WScript.Echo(msg)

  2. Hey, i'm writing a vbs script that needs to check if a file exists.

    obj.FileExists("C:\Program Files\Installshield Installation Information\{guid}\setup.exe")

    When this code is executed the FileExists always returns true even if the file doesn't exist. I've done some testing and found that the problem is the spaces. Once it reaches the first space it stops reading, so technically it's only looking for C:\Program. Is there any kind of escape character that needs to go in front of the spaces? I've done some researching online and it seems people say this shouldn't happen, but it does, and I can guarantee it's because of the spaces.

×
×
  • Create New...