Patient Rename button

Files that are temporarily in use (e.g., still downloading, being written to etc.) cannot be renamed until they are no longer in use (closed).

This button script allows you to specify new names for selected files, and they will be automatically renamed as soon as they are no longer in use, or when they finish downloading.

This button supports two kinds of "busy" files:

  • Files that are currently in use (locked) by some program.
  • Files which have a ".part" extension while being downloaded (e.g., test.mp4.part) -- such files are created by the web browsers, download managers, YouTube download tools etc.

Step 1: for each selected file you'll be asked for a new name.

Step 2: any remaining renames are indicated in a list until they are automatically done.


  • The "Pending Renames" dialog must remain open for any pending files to be renamed. Closing it is equivalent to clicking Cancel.
  • The script dialogs currently cannot be minimized which may be inconvenient :slight_smile:
  • Each separate click on the button will create a new instance of the "Pending Rename" dialog.

Download this button:
Patient Rename.dcf (10.9 KB)

Some extra details on how it works

The script tries to rename the files immediately, and if it fails, it will create a "Pending Rename" dialog with a status list and retry every second. Once a file is renamed it is removed from the list, and once all files are renamed the status dialog closes.
If a file no longer exists, the script will give up on it.
If a file has a ".part" extension, the script will wait until it no longer has a ".part" extension before making a rename attempt.