-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
hi I'm using your script works really good for me. thank you very much
i was wondering if you can add a File System Watcher when ever we finish download any .mkv then the BATCH file get triggered.
i found something that's working for that with powershell, but because i am not a programmer i have no idea of what I'm doing but it think you can make it shine.
### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "Z:\media_downloads\downloads"
$watcher.Filter = "*.mkv*"
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $true
### DEFINE ACTIONS AFTER AN EVENT IS DETECTED
$action = { start-process C:\tools\Cleanup_Eng.bat
}
### DECIDE WHICH EVENTS SHOULD BE WATCHED
Register-ObjectEvent $watcher "Changed" -Action $action
while ($true) {sleep 5}
source:
https://itectec.com/superuser/how-to-monitor-a-folder-and-trigger-a-command-line-action-when-a-file-is-created-or-edited/
https://powershell.one/tricks/filesystem/filesystemwatcher
https://www.jamsscheduler.com/blog/how-to-execute-a-bat-file-within-a-powershell-job/
lavaground
Metadata
Metadata
Assignees
Labels
No labels