How can I monitor a Windows directory for changes?

后端 未结 7 1990
感情败类
感情败类 2020-11-29 22:32

When a change is made within a directory on a Windows system, I need a program to be notified immediately of the change.

Is there some way of executing a program whe

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 23:00

    There is no utility or program the comes with Windows to do it. Some programming required.

    As noted in another answer, .NET's FileSystemWatcher is the easiest approach.

    The native API ReadDirectoryChangesW is rather harder to use (requires an understanding of completion ports).

提交回复
热议问题