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:

%date%      - format [YYYY-MM-DD], e. g. "2012-12-22"
%time%      - format [hhmmss], e. g. "123044"
%timestamp% - format [YYYY-MM-DD hhmmss], e. g. "2012-12-22 123044"

%year%      - e. g. "2012"
%month%     - e. g. "12"
%day%       - e. g. "22"

%hour%      - e. g. "12"
%min%       - e. g. "30"
%sec%       - e. g. "44"

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



Environment variables: (Windows)

%AllUsersProfile%   e. g. C:\ProgramData
%AppData%           
e. g. C:\Users\<username>\AppData\Roaming
%ComputerName%      
e. g. Zenju-PC
%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
%Temp%              
e. g. C:\Windows\Temp
%UserName%          
e. g. Zenju
%UserProfile%       
e. g. C:\Users\<username>
%WinDir%            
e. g. C:\Windows




Special folder locations (Windows)

%csidl_Desktop%     e. g. C:\Users\<username>\Desktop
%csidl_Favorites%   
e. g. C:\Users\<username>\Favorites
%csidl_MyDocuments% 
e. g. C:\Users\<username>\Documents
%csidl_MyMusic%     
e. g. C:\Users\<username>\Music
%csidl_MyPictures%  
e. g. C:\Users\<username>\Pictures
%csidl_MyVideos%    
e. g. C:\Users\<username>\Videos
%csidl_Nethood%     
e. g. C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Network Shortcuts
%csidl_Programs%    
e. g. C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
%csidl_Resources%   
e. g. C:\Windows\Resources
%csidl_StartMenu%   
e. g. C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu
%csidl_Startup%     
e. g. C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\StartUp
%csidl_Templates%   
e. g. C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Templates


Note: Most macros listed here also have a variant for 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 FreeFileSync batch file C:\SyncJob.ffs_batch contains macro %MyVar% instead of an absolute target folder and is invoked by a *.cmd file:

set MyVar=C:\Target
"C:\Program files\FreeFileSync\FreeFileSync.exe" C:\SyncJob.ffs_batch
::%MyVar% is resolved as C:\Target during synchronization