マクロ

マクロ

FreeFileSync ユーザーマニュアル:
クイック スタート コマンド ライン 比較設定 夏時間 除外ファイル エキスパート設定 外部アプリケーション マクロ パフォーマンス リアルタイム同期 RTS: サービスとして実行 スケジュール バッチ ジョブ 同期設定 (S)FTP セットアップ ヒントとトリック 可変ドライブ レター バージョニング ボリューム シャドウ コピー
マクロ

すべてのディレクトリ パスには、同期中に展開されるマクロが含まれている場合があります。各マクロの始まりと終わりは % 文字でマークされています。日付や時刻を扱う特殊なマクロに加えて、 オペレーティング システムの環境変数 も使用できます。
内部マクロ
Internal Macros
MacroExampleFormat







%Date%2025-02-14[ YYYY-MM-DD ]
%Time%022842[ hhmmss ]
%TimeStamp%2025-02-14 022842[ YYYY-MM-DD hhmmss ]
%Year%2025
%Month%02[ 01–12 ]
%MonthName%Feb[ Jan–Dec ]
%Day%14[ 01–31 ]
%Hour%02[ 00–23 ]
%Min%28[ 00–59 ]
%Sec%42[ 00–59 ]
%WeekDay%5[ 1–7 ] week begin may vary locally
%WeekDayName%Fri[ Mon–Sun ]
%Week%07[ 01–52 ] calendar week
Environment Variables (Windows)
MacroExample





%AllUsersProfile%C: \ ProgramData
%AppData%C: \ Users \ Zenju \ AppData \ Roaming
%ComputerName%Zenju-PC
%LocalAppData%C: \ Users \ Zenju \ AppData \ Local
%ProgramData%C: \ ProgramData
%ProgramFiles%C: \ Program Files
%ProgramFiles(x86)%C: \ Program Files (x86)
%Public%C: \ Users \ Public
%Temp%C: \ Windows \ Temp
%UserName%Zenju
%UserProfile%C: \ Users \ Zenju
%WinDir%C: \ Windows
Special Folder Locations (Windows)
MacroExample





%csidl _ Desktop%C: \ Users \ Zenju \ Desktop
%csidl _ Documents%C: \ Users \ Zenju \ Documents
%csidl _ Pictures%C: \ Users \ Zenju \ Pictures
%csidl _ Music%C: \ Users \ Zenju \ Music
%csidl _ Videos%C: \ Users \ Zenju \ Videos
%csidl _ Downloads%C: \ Users \ Zenju \ Downloads
%csidl _ Favorites%C: \ Users \ Zenju \ Favorites
%csidl _ Resources%C: \ Windows \ Resources
%csidl _ QuickLaunch%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Internet Explorer \ Quick Launch
%csidl _ StartMenu%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Windows \ Start Menu
%csidl _ Programs%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Windows \ Start Menu \ Programs
%csidl _ Startup%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Windows \ Start Menu \ Programs \ StartUp
%csidl _ Nethood%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Windows \ Network Shortcuts
%csidl _ Templates%C: \ Users \ Zenju \ AppData \ Roaming \ Microsoft \ Windows \ Templates
注記: 上記のマクロのほとんどは、パブリック フォルダ用のバリアントがあります。たとえば、%csidl _ Documents% には %csidl _ PublicDocuments% があります。
ヒント :batまたはcmdファイルで新しい一時環境変数を作成することで、ffs _ batch構成ファイルに柔軟性を追加できます。これらの環境変数は、FreeFileSyncによって実行時に評価されます。
FreeFileSyncのバッチファイル C: \ SyncJob.ffs _ batch contains macro %MyVar% を含んでおり、cmdファイルによって呼び出されています。
set MyVar=C: \ Target
"C: \ Program files \ FreeFileSync \ FreeFileSync.exe" C: \ SyncJob.ffs _ batch
::%MyVar% is resolved as C: \ Target during synchronization
set コマンドで作成された一時的な環境変数は、FreeFileSync 実行可能ファイルを直接呼び出して同期を開始した場合にのみ有効です。start /wait を使用すると、これらの一時変数がない新しいプログラムコンテキストが作成されます。