Logfile-Support for Environment variables

Get help for specific problems
Posts: 4
Joined: 21 Dec 2019

Syncchroton

Hallo,
I miss support for Environment variables to get expanded as logfile definition.
Definition of logfile I tried was: <LogFolder>%FFS_LogDir%\%timestamp%-Sync-%COMPUTERNAME%</LogFolder>
Result is that internal macros were expanded but environment variables not.
Could you please add support for environment variables due to better customization in local networks?

Thanks for amazing freefilesync-tool and best regards
Syncchroton
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

I'm not sure what it is that is not working in your case. Using "%COMPUTERNAME%" for the log folder paths works in my tests.
Posts: 4
Joined: 21 Dec 2019

Syncchroton

FFS-Macros working fine but Environment variable %FFS_LogDir% defined in outside shell is not expanded correct as it is on DirPairs.
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

%COMPUTERNAME% *is* an environment variable. Expanding user-defined environment variables also works in my test.
Environment variables are inherited from the parent process. My guess is the problem is in the way you start FreeFileSync. For example consider the following note in the FFS manual:
Temporary environment variables created with the set command are only valid if the synchronization is started by calling the FreeFileSync executable directly. Using start /wait would create a new program context without these temporary variables
https://freefilesync.org/manual.php?topic=macros
Posts: 4
Joined: 21 Dec 2019

Syncchroton

You are right process context was the problem - it was my fault. Everything works fine now after applying settings in user profile permanently.