I have been using environmental variables for Folder Pair paths in FreeFileSync, and it has been an incredibly helpful feature. It allows me to reuse .ffs_gui files across multiple computers, simplifying my synchronization tasks.
Current Setup
On my computers, I define the following system environmental variables:
fs = D:\fs ; primary file location on a large, slower HDD; main FFS network sync target
fs2 = C:\fs ; secondary file location on a smaller, faster SSD; main FFS local sync target
mch = 005 ; a unique identifier for each computer
An example Folder Pair:
%fs%\0\m\%mch%\0\w\s\scripts | %fs2%\0\m\%mch%\0\w\s\scripts
D:\fs\0\m\005\0\w\s\scripts | C:\fs\0\m\005\0\w\s\scripts
My Challenge
Not all of my computers have a D: drive; some use E: or other drive letters. To address this, I’ve implemented indirect environmental variables per computer:
fsC = C:\fs ; direct environmental variable
fsE = E:\fs ; direct environmental variable
mch = 005 ; direct environmental variable
fs = %fsE% ; indirect environmental variable
fs2 = %fsC% ; indirect environmental variable
This setup allows my scripts to remain functional across all systems by referencing %fs% and %fs2% consistently.
My Issue
However, FreeFileSync does not fully expand indirect environmental variables in Folder Pairs. Instead of expanding the variables %fs% and %fs2% to their final paths (E:\fs, C:\fs, etc.), it stops at the intermediate values (%fsE%, %fsC%). For example:
Folder Pair:
%fs%\0\m\%mch%\0\w\s\scripts | %fs2%\0\m\%mch%\0\w\s\scripts
D:\fs\0\m\005\0\w\s\scripts | C:\fs\0\m\005\0\w\s\scripts
C:\Program Files\FreeFileSync\%fsD%\0\m\005\0\w\s\scripts | C:\Program Files\FreeFileSync\%fsC%\0\m\005\0\w\s\scripts
Feature Request
I kindly request that FreeFileSync be updated to fully expand indirect environmental variables in Folder Pairs.
Specifically:
Recognize when an environmental variable resolves to another variable and continue expansion until the final value is reached.
Benefits
• Enables consistent and portable synchronization setups across computers with varying drive configurations.
• Enhances compatibility with advanced scripting workflows that rely on indirect environmental variables.
• Aligns FreeFileSync’s handling of environmental variables with the behavior expected in most operating systems.
• This enhancement would greatly improve the flexibility and usability of FreeFileSync, particularly for users managing multiple systems with diverse configurations.
Thank you for considering this request.
— Regards, Sam Katakouzinos