1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Foldermonitor with /W option

Discussion in 'Support' started by cgunhouse, Jan 8, 2016.

  1. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    I have been try /W10 with Foldermonitor, that is a 10 millisecond wait but nothing happen when something happens to the directory that would have fire the Foldermonitor. Take the /W10 off, fires as expected.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,091
    Likes Received:
    85
    Please post the exact syntax you're using, and what you're doing to fire Foldermonitor.
     
  3. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    foldermonitor /S C:\JPSoft\logs /W10 CREATED DELETE MODIFIED RENAMED FOREVER c:\JPSoft\Batches\test.bat

    I've tried placing the "/W10" in different places as well as putting a space between the "/W" and "10".


    foldermonitor /S C:\JPSoft\logs CREATED DELETE MODIFIED RENAMED FOREVER c:\JPSoft\Batches\test.bat

    Works fine.
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,129
    Likes Received:
    33
    Help nit: On the FOLDERMONITOR page, clicking "/S(ubdirectories)" does not take you down the page to the description of that option. It works for any of the other options.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,129
    Likes Received:
    33
    (Below) Without "/W10", I hear the beep on the TOUCH but not on the DEL. With "/W10" I hear no beeps at all.
    Code:
    v:\> foldermonitor /S v:\ CREATED DELETE MODIFIED RENAMED FOREVER beep
    
    v:\> touch /c file.tmp
    2016-01-08 16:29:07.431  V:\file.tmp
    
    v:\> del file.tmp
    Deleting V:\file.tmp
      1 file deleted
    
    v:\> touch /c file.tmp
    2016-01-08 16:29:13.806  V:\file.tmp
    
    v:\> del file.tmp
    Deleting V:\file.tmp
      1 file deleted
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,091
    Likes Received:
    85
    Your syntax is wrong -- it should be "DELETED", not "DELETE".
     
  7. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,129
    Likes Received:
    33
    OK. With that fixed, I get both sounds without "/W10" and no sounds with "/W10".
     
  8. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    Sorry my mistake on the DELETE instead of DELETED

    foldermonitor /S C:\JPSoft\logs /W10 CREATED DELETED MODIFIED RENAMED FOREVER c:\JPSoft\Batches\test.bat

    Still doesn't work, C:\jpsoft\logs is where TCC logs are stored so c:\JPSoft\Batches\test.bat should be firing constantly but nothing is happening.


    foldermonitor /S C:\JPSoft\logs CREATED DELETED MODIFIED RENAMED FOREVER c:\JPSoft\Batches\test.bat


    Without the "/W10" is firing constantly until I kill the TCC process.
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,091
    Likes Received:
    85
    Two problems - you're using FOLDERMONITOR & /W incorrectly, and you don't understand how it works.

    First, you would never use /Wn with something like a create / delete / rename, only with something like a write & modify. Which takes us to problem #2 - the way it works is that TCC calls the Windows API and waits for a change to the file / directory. When one happens, Windows returns the info and TCC starts its timer and calls the Windows API again. When another action occurs, TCC checks the timer to see if the wait period has been exceeded and if so, TCC executes the action specified in the FOLDERMONITOR call.

    So if you only have the monitored event occur once, you won't see the action executed.

    (Also, the /Wn needs to be the first argument to FOLDERMONITOR.)
     
  10. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    I see how it works now; not what I was look for it to do. Instead I built the timing into the command the FolderMonitor fired. Not sure why there is an order dependency on the /Wn switch, but I guess there is a reason. Thanks.
     
  11. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,091
    Likes Received:
    85
    FOLDERMONITOR has to know whether the /W is an option or part of the command action.
     

Share This Page