If you want to use DirEvents in a Batch script I strongly recommend to download the example scripts along with the DirEvents binary. You can't use DirEvents in a FOR /F loop because it is buffering the records and doesn't begin to iterate. You have to work around using SET /P like that
DirEvents"C:\"/s|(cmd/von/q/d/c^"for /l %%# in (^) do set "rec="^&set /p "rec="^&(if not defined rec exit^)^&^ echo work with '!rec!' here^")
Replace the echo line with your code. Note that the processing of the records is done in command-line mode. You have to concatenate commands using &. If you want to write your code in multiple lines (as I did above) you have to escape line ends using ^.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to use DirEvents in a Batch script I strongly recommend to download the example scripts along with the DirEvents binary. You can't use DirEvents in a FOR /F loop because it is buffering the records and doesn't begin to iterate. You have to work around using SET /P like that
Replace the
echoline with your code. Note that the processing of the records is done in command-line mode. You have to concatenate commands using&. If you want to write your code in multiple lines (as I did above) you have to escape line ends using^.