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
%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