Foldermonitor with /W option

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Dec 2, 2008
212
2
Canada
#1
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.
 
Dec 2, 2008
212
2
Canada
#3
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
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
(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
 
Dec 2, 2008
212
2
Canada
#8
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.
 

rconn

Administrator
Staff member
May 14, 2008
10,289
90
#9
OK. With that fixed, I get both sounds without "/W10" and no sounds with "/W10".
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.)
 
Dec 2, 2008
212
2
Canada
#10
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.
 

rconn

Administrator
Staff member
May 14, 2008
10,289
90
#11
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.
FOLDERMONITOR has to know whether the /W is an option or part of the command action.