# DEFINE ACTIONS AFTER AN EVENT IS DETECTED $watcher = New-Object System.IO.FileSystemWatcher StartMonitoring.ps1 # SET FOLDER TO WATCH FILES TO WATCH SUBFOLDERS YES/NO 19:22:14, Deleted, D:\source\New Text Document.txt 19:22:09, Changed, D:\source\New Text Document.txt 19:22:04, Created, D:\source\New Text Document.txt You can replace the action and do whatever you want e.g call an external tool Example log file This script monitors a certain folder and writes a logfile. It can be used since Windows Vista (.NET and PowerShell is preinstalled) without any additional tools. At work we use Powershell to monitor folders.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |