Macros


All directory names may contain macros that are expanded during synchronization. Begin and end of each macro is marked by a '%' character. Besides special macros handling time and date, the operating system's environment variables can also be used.


Internal macros:

%time%    - current time, format [hhmmss], e. g. "201340"
%date%    - current date, e. g. "2010-07-13"

%weekday% - day of the week, e. g. "Monday"
%week%    - calendar week, e. g. "28"

%day%     - current day, e. g. "21"
%month%   - current month, e. g. "July"
%year%    - current year, e. g. "2010"

%hour%    - current hour, e. g. "20"
%min%     - current minute, e. g. "13"
%sec%     - current second, e. g. "40"



Environment variables: (Windows)

%AllUsersProfile%   e. g. C:\ProgramData
%AppData%           
e. g. C:\Users\username\AppData\Roaming
%LocalAppData%      
e. g. C:\Users\username\AppData\Local
%ProgramData%       
e. g. C:\ProgramData
%ProgramFiles%      
e. g. C:\Program Files
%ProgramFiles(x86)% 
e. g. C:\Program Files (x86)
%Public%            
e. g. C:\Users\Public
%UserProfile%       
e. g. C:\Users\username
%WinDir%            
e. g. C:\Windows
%Temp%              
e. g. C:\Windows\Temp




Special folder locations (Windows)

%csidl_Desktop%     e. g. C:\Users\username\Desktop
%csidl_MyMusic%     
e. g. C:\Users\username\My Documents\My Music
%csidl_Pictures%    
e. g. C:\Users\username\My Documents\My Pictures
%csidl_MyVideo%     
e. g. C:\Users\username\My Documents\My Videos
%csidl_MyDocuments% 
e. g. C:\Users\username\My Documents
%csidl_StartMenu%   
e. g. C:\Users\username\Start Menu
%csidl_Favorites%   
e. g. C:\Users\username\Favorites
%csidl_Templates%   
e. g. C:\Users\username\Templates
%csidl_Resources%   
e. g. C:\Windows\Resources


Note: Each macro listed here also has a variant to address public folders. E.g. csidl_MyMusiccsidl_PublicMusic


Example:




Hint:

You can add a great amount of flexibility to Batch Synchronization (*.ffs_batch) by creating new temporary environment variables in a *.bat/*.cmd file that are evaluated by FreeFileSync at runtime!


Example:

The batch configuration file C:\SyncJob.ffs_batch contains macro %MyVar% instead of an absolute target directory and is invoked by a *.cmd file:

set MyVar=C:\Target
cd "C:\Program files\FreeFileSync"
FreeFileSync.exe C:\SyncJob.ffs_batch
(->%MyVar% is replaced by C:\Target during execution)