Results 1 to 5 of 5

Thread: Checking For In Use

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Checking For In Use

    I am way back in SetupBuilder 10 to which we just moved from SB4 -
    yeah, I know.

    I am trying to check for in-use files. I must not be doing this is the
    right place within the script because it isn't working for me.
    Example, I have the following in my script:

    Set Variable %APPFILES_LOCKED% to FUNCTION:Check In-use Folder Tree
    ("%_SB_INSTALLDIR%", 2) [IgnoreSelf]
    Display Message Box ("%APPFILES_LOCKED%", "Folder In Use")

    The function always assigns 0 to %APPFILES_LOCKED% evenb with multiple
    files opened and in use.


    I have also tried an individual single file like:

    Set Variable %INUSE% to FUNCTION:Check In-use File
    ("%_SB_INSTALLDIR%\shared.txt")
    Display Message Box ("%INUSE%", "Warning")


    It doesn't matter what I do with this file shared.txt - It can be
    opened, it can in fact be in edit mode with changes etc... But the
    function never returns that the file is in-use and always returns 0

    These are straight out of the manual - what am I missing?? Help!!

    Andy Morgan

  2. #2

    Default Re: Checking For In Use

    PS: SB overwrites the shared.txt file anyway - even when in an edited
    and open state. If I close it after running the SB script - the file
    new file was saved.

    Andy Morgan

  3. #3

    Default Re: Checking For In Use

    what are you using to "hold" the .txt file? Are you sure that the file
    is actually locked when open in your editor?

    Jeff Slarve

  4. #4

    Default Re: Checking For In Use

    Hi Jeff,

    It doesn't matter what I try to test. This also fails for me:

    Set Variable %INUSE% to FUNCTION:Check In-use File
    ("%_SB_INSTALLDIR%\inv.exe")

    The inv.exe application is running with a browse open.

    I went through all the SB examples and found Detect Active Application
    and tried this:

    Set Variable %ACTIVEAPP% to FUNCTIONetect Active Application
    ("inv.exe") [File Name]

    But that only works if the exe is running on THAT particular pc. A
    client pc with the application open does not return true.

    SB4 just did this and basically exited if files were in use.

    But I cannot see the script in SB4 - there is a file menu option but
    its greyed out. UGH

    Andy

  5. #5

    Default Re: Checking For In Use

    Hi Jeff,

    Nevermind I have it all working now. I was trying to use the variables
    BEFORE their values were set. Earlier I had it in the right place but
    mistakes in code. By the time I got the code right - I was in the
    wrong place LOL

    Thanks for trying to help

    Andy

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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