Reply to Thread

Post a reply to the thread: Locating existing file

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 12-19-2005, 09:39 AM
    linder

    Re: Locating existing file

    Could you please send me a demo script where it does not work? All our test scripts (with drive variables) work fine in build 1354.

    Thank you!
  • 12-19-2005, 08:54 AM
    Joe Snyder

    Re: Locating existing file

    Friedrich:

    That works as advertised.
  • 12-19-2005, 08:50 AM
    linder

    Re: Locating existing file

    Joe,

    Just checked this and it works fine here on our machines. I am using the following:

    Set Variable %DRIVELETTERTOTEST% to c:
    Set Variable %FILEFOUND% to ""
    Set Variable %FILEFOUND% to Search for File("FMGMASTR.EXE")
    Display Message Box "%FILEFOUND%\n\n%_SB_ERRORCODE%\n\n%DRIVELETTERTOT E..." -- ""

    FMGMASTR.EXE is in c:\general and the installer detected the file.
  • 12-19-2005, 08:30 AM
    linder

    Re: Locating existing file

    Joe,

    I'll check this.

    BTW, what happens if you enter D:\ in "Path to search" (instead of %DRIVE_LETTER_TO_TEST%\)

    Thanks,
  • 12-19-2005, 08:18 AM
    Joe Snyder

    Re: Locating existing file

    I must be be missing something.

    Search for File function
    Variable %FILEFOUND%
    Filename FMGMASTR.EXE
    Path to search: %DRIVE_LETTER_TO_TEST%\ (tried without \ also)
    Return List of all matches is ON

    Debugger shows %DRIVE_LETTER_TO_TEST% to contain D: from previous GetListItem function.

    After execution:
    %SB_ERRORCODE%= empty
    %FILEFOUND%= empty

    I know there are several occurances of the FMGMASTR.exe file on this drive.
    Attempted to send stripped down script but zip file is too large for submission as an attachment.
  • 12-18-2005, 11:54 PM
    linder

    Re: Locating existing file

    Joe,

    The Search for File function allows you to search for a specific file in the local or network file system and places the location in a variable.

    If the function succeeds, the %_SB_ERRORCODE% return value is nonzero. If the function fails, the return value is zero.

    Does this help?
  • 12-18-2005, 08:53 PM
    Joe Snyder

    Locating existing file

    I am trying to determine if a file exists anywhere on a particular drive. Ideally I need to know if this file is anywhere on the installation machine. Have looked at "If File/Folder" and "Search for File" functions but both seem to require that the path be specified. Is there a way to find a file by simply supplying C: and the filename argument?

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •