KeyRoutines
TriggerFreetrigger.file.changed

Run a routine when files in a folder change on Windows

Folder changed starts a routine when something happens to files in a folder. It's the trigger for scan folders, screenshot folders, synced folders and anything else that fills up over time.

How it works

  • Choose the folder, a name pattern such as *.jpg; *.png, and whether to include subfolders.
  • Pick which changes count: created, changed and renamed are on by default; deleted or moved away is off.
  • It waits until a file has been quiet for the settle time (1 second by default), so a file being written fires once, and one created then deleted fires nothing.
  • Temporary files like .tmp, .crdownload and Office ~$ files are ignored unless you turn that off.
  • The routine gets the file's details, the kind of change and the old path for renames; changes made by KeyRoutines itself don't count.

Routines that use it

New screenshot, new name

When a PNG appears in Screenshots, Rename file gives it a date-based name.

Scanner inbox

When a PDF lands in the scan folder, Move or copy file files it into Documents\Scans and Show banner confirms it.

Reload on config edits

When a settings file changes, Read JSON value picks up the new value and applies it.

Settings

SettingWhat it does
FolderThe folder to watch.
PatternOnly names like these, e.g. *.pdf or *.jpg; *.png (empty = every file).
Include subfoldersAlso watch the folders inside it.
CreatedWhen a file appears.
ChangedWhen a file's contents change.
RenamedWhen a file is renamed.
DeletedWhen a file is deleted or moved away.
SettleFire once the file has been quiet this long (a file being written changes many times).
Ignore temporaryadvancedIgnore temporary files (.tmp, .crdownload, ~$ Office files).

Questions

How do I watch a folder for new files on Windows?
Use the Folder changed trigger, pick the folder and leave "when a file appears" on. Add steps for what should happen to each new file.
Why does my routine fire only once while a big file copies?
It waits for the file to be quiet for the settle time before firing. That way a file that changes many times while it's written starts the routine once.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.