Page 1 of 1

📃 Add Built‑In Support for Writing %ActivSel% (and other list macros) to a Temp File

Posted: 26.08.2026, 02:16
by Dr_Eyeball
Hello,

I would like to request a new feature for FreeCommanderXE’s Favorite Tools system, specifically for users who work with large file selections and external file processing.

Related Topics
This feature request topic might be related, but I didn't understand its concept, so I'm not sure: Folder List built with a script

Problem Summary

When using "%ActivSel%" or other list‑based macros inside a Favorite Tool command, FC expands the full list directly into the command line.
This works for small selections, but once the list becomes large (1000+), the expanded command exceeds the argument length limits of:
  • Windows Terminal ("wt.exe")
  • PowerShell ("pwsh.exe")
  • Windows command line parsing
  • FC’s own command construction
This results in execution errors similar to:

Code: Select all

The system cannot find the file specified.
The expanded parameter list cannot hold the entire list.
In practice, long lists cause the execution to fail due to:
  • truncated arguments
  • broken pathnames
  • commands failing to execute
  • external scripts receiving incomplete or corrupted lists
This makes it impossible to reliably pass large selections to external tools.

Why This Happens

Windows Terminal and PowerShell both have strict limits on command length.
When FCXE expands "%ActivSel%" directly into the command line, the command often becomes too long, causing:
  • WT to split or truncate the command
  • PowerShell to misinterpret tokens
  • external scripts to fail
This is not a FC bug — it is a limitation of Windows command‑line processing.

However, FCXE could provide a built‑in solution.

1. Proposed Solution

1. Add a checkbox in Favorite Tool configuration:
✅ Write list‑based macros (%ActivSel%, etc.) to a temporary file”

When enabled:
  • FCXE writes the full list to a temp file (UTF‑8, newline‑separated)
  • FCXE exposes the temp filename via a new macro, for example:

    Code: Select all

    %SelListTempFile%
This file would contain the full list, regardless of length, without any command‑line limitations.

Dual Window Panes

Perhaps you need more than 1 macro to handle "Left"/"Right" and "Active"/"Inactive" windows too.

2. Alternative Implementation

The new macro itself ("%ActivSelTempFile%") being present on the command line could trigger the temp file to be generated, rather than adding a checkbox too.

This macro would behave like:
  • "%ActivSel%" → expanded inline
  • "%ActivSelTempFile%" → written to a temp file automatically
This gives users a simple, predictable way to pass large selections to external scripts.

Benefits
  • External tools receive the full list reliably
  • No truncation
  • No quoting issues
  • No wt.exe/PowerShell argument parsing problems
  • Works with thousands of files
  • Works with long Unicode paths
  • Works with any separator (comma, pipe, newline)
This would solve the problem completely.

Summary of Requested Features
  • Optional: Add a checkbox: “Write selection list to temp file”
  • Add macro:

    Code: Select all

    %SelListTempFile%
This would allow users to reliably pass arbitrarily long file lists to external applications without hitting Windows command‑line limits.

Re: 📃 Add Built‑In Support for Writing %ActivSel% (and other list macros) to a Temp File

Posted: 26.08.2026, 20:13
by Marek
There are several placeholders for creating the file containing selected elements, example

Code: Select all

Selected items (full path) as file - active (%ActivSelAsFile%)
Selected items (full path) as file - active (%ActivSelAsFileUtf8%)


Is it not what you want?