I created a .btm to test the parameters of FOLDERMONITOR based on my understanding of the documentation for it. The file contains:
After running the .BTM file if I execute FOLDERMONITOR, I get:
Now I use an editor that makes a backup (.bak extension) of file and then save the new version. So let us save test.btm in “c:\jpsoft\Startup” and here is the results:
The editor actually does a lot to backup and save, but of all the foldmonitor commands only,
worked.
The documentation says:
Based on this, we should have got:
The documentation says:
So we should have got:
The "/E" issue was fixed:
19.02.38 FOLDERMONITOR - fixed a problem with /E (not matching the documentation)
Does this mean there is still an issue with "/E"?
It also appears that multiple directories references on a single command doesn't work.
Code:
foldermonitor /c
foldermonitor c:\jpsoft\Batches CREATED DELETED MODIFIED RENAMED FOREVER echo (1) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
foldermonitor c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED FOREVER echo (2) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
foldermonitor c:\jpsoft\Batches c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED FOREVER echo (3) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
foldermonitor c:\jpsoft\Batches /E"c:\jpsoft\Batches\*.bak" CREATED DELETED MODIFIED RENAMED FOREVER echo (4) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
foldermonitor c:\jpsoft\Startup /E"c:\jpsoft\Startup\*.bak" CREATED DELETED MODIFIED RENAMED FOREVER echo (5) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
foldermonitor c:\jpsoft\Batches c:\jpsoft\Startup /E"c:\jpsoft\Batches\*.bak" /E"c:\jpsoft\Startup\*.bak" CREATED DELETED MODIFIED RENAMED FOREVER echo (6) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
After running the .BTM file if I execute FOLDERMONITOR, I get:
c:\jpsoft\Batches CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (1) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (2) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (3) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (4) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (5) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches c:\jpsoft\Startup /E"c:\jpsoft\Batches\*.bak" /E"c:\jpsoft\Startup\*.bak" CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (6) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (2) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (3) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (4) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (5) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
c:\jpsoft\Batches c:\jpsoft\Startup /E"c:\jpsoft\Batches\*.bak" /E"c:\jpsoft\Startup\*.bak" CREATED DELETED MODIFIED RENAMED (0/FOREVER) echo (6) %_folderaction %_foldercount %_foldername %_folderfile1 %_folderfile2
Now I use an editor that makes a backup (.bak extension) of file and then save the new version. So let us save test.btm in “c:\jpsoft\Startup” and here is the results:
(2) DELETED 1 c:\jpsoft\Startup test.btm.bak
(2) RENAMED 2 c:\jpsoft\Startup test.btm
(2) RENAMED 3 c:\jpsoft\Startup test.btm.bak
(2) MODIFIED 4 c:\jpsoft\Startup test.btm.bak
(2) CREATED 5 c:\jpsoft\Startup test.btm
(2) MODIFIED 6 c:\jpsoft\Startup test.btm
(2) MODIFIED 7 c:\jpsoft\Startup test.btm
(2) MODIFIED 8 c:\jpsoft\Startup test.btm
(2) RENAMED 2 c:\jpsoft\Startup test.btm
(2) RENAMED 3 c:\jpsoft\Startup test.btm.bak
(2) MODIFIED 4 c:\jpsoft\Startup test.btm.bak
(2) CREATED 5 c:\jpsoft\Startup test.btm
(2) MODIFIED 6 c:\jpsoft\Startup test.btm
(2) MODIFIED 7 c:\jpsoft\Startup test.btm
(2) MODIFIED 8 c:\jpsoft\Startup test.btm
The editor actually does a lot to backup and save, but of all the foldmonitor commands only,
foldermonitor c:\jpsoft\Startup CREATED DELETED MODIFIED RENAMED FOREVER echo (2) %%_folderaction %%_foldercount %%_foldername %%_folderfile1 %%_folderfile2
worked.
The documentation says:
If you want to monitor multiple conditions for a file or folder, put them into a single FOLDERMONITOR command. FOLDERMONITOR creates a separate thread for each FOLDERMONITOR command, so if you have multiple commands you will be wasting CPU time, RAM, and risk having command executed simultaneously in different threads.
Based on this, we should have got:
(3) DELETED 1 c:\jpsoft\Startup test.btm.bak
(3) RENAMED 2 c:\jpsoft\Startup test.btm
(3) RENAMED 3 c:\jpsoft\Startup test.btm.bak
(3) MODIFIED 4 c:\jpsoft\Startup test.btm.bak
(3) CREATED 5 c:\jpsoft\Startup test.btm
(3) MODIFIED 6 c:\jpsoft\Startup test.btm
(3) MODIFIED 7 c:\jpsoft\Startup test.btm
(3) MODIFIED 8 c:\jpsoft\Startup test.btm
(3) RENAMED 2 c:\jpsoft\Startup test.btm
(3) RENAMED 3 c:\jpsoft\Startup test.btm.bak
(3) MODIFIED 4 c:\jpsoft\Startup test.btm.bak
(3) CREATED 5 c:\jpsoft\Startup test.btm
(3) MODIFIED 6 c:\jpsoft\Startup test.btm
(3) MODIFIED 7 c:\jpsoft\Startup test.btm
(3) MODIFIED 8 c:\jpsoft\Startup test.btm
The documentation says:
/E
Filename to be excluded. If you want to exclude multiple files, use multiple /E options. If you want to exclude a file in a specific subdirectory, the filename should include the relative path from the folder name. The name can include wildcards.
Filename to be excluded. If you want to exclude multiple files, use multiple /E options. If you want to exclude a file in a specific subdirectory, the filename should include the relative path from the folder name. The name can include wildcards.
So we should have got:
(5) RENAMED 1 c:\jpsoft\Startup test.btm
(5) CREATED 2 c:\jpsoft\Startup test.btm
(5) MODIFIED 3 c:\jpsoft\Startup test.btm
(5) MODIFIED 4 c:\jpsoft\Startup test.btm
(5) MODIFIED 5 c:\jpsoft\Startup test.btm
(6) RENAMED 1 c:\jpsoft\Startup test.btm
(6) CREATED 2 c:\jpsoft\Startup test.btm
(6) MODIFIED 3 c:\jpsoft\Startup test.btm
(6) MODIFIED 4 c:\jpsoft\Startup test.btm
(6) MODIFIED 5 c:\jpsoft\Startup test.btm
(5) CREATED 2 c:\jpsoft\Startup test.btm
(5) MODIFIED 3 c:\jpsoft\Startup test.btm
(5) MODIFIED 4 c:\jpsoft\Startup test.btm
(5) MODIFIED 5 c:\jpsoft\Startup test.btm
(6) RENAMED 1 c:\jpsoft\Startup test.btm
(6) CREATED 2 c:\jpsoft\Startup test.btm
(6) MODIFIED 3 c:\jpsoft\Startup test.btm
(6) MODIFIED 4 c:\jpsoft\Startup test.btm
(6) MODIFIED 5 c:\jpsoft\Startup test.btm
The "/E" issue was fixed:
19.02.38 FOLDERMONITOR - fixed a problem with /E (not matching the documentation)
Does this mean there is still an issue with "/E"?
It also appears that multiple directories references on a single command doesn't work.