Command-line options

Get help for specific problems
Posts: 4
Joined: 16 Dec 2009

codesaway

What command line argument(s) do I pass to run FreeFileSync and have "C:\"
show up in the GUI as the left-hand sync directory?

I tried passing "C:\", but an error message comes up - 'File does not exist:
"C:\"'.

I'm trying to integrate FreeFileSync into FreeCommander as one of my "favorite
tools", so that I can open FreeFileSync and have the current directory as the
left-hand side for the sync. Then, I only need to specify the right-hand side
- resulting in a quicker sync.
User avatar
Site Admin
Posts: 7058
Joined: 9 Dec 2007

Zenju

All configuration data is passed to FreeFileSync via either *.ffs_batch or
*.ffs_gui files. But a new feature of v3.2 should help for your usecase:

Use temporal environment variables to insert directory names externally. See
the helpfile for details.

Regards, Zenju
Posts: 4
Joined: 16 Dec 2009

codesaway

Thank you so much, it works great! I passed the directory to a BAT file, which
then loads FreeFileSync.

Is it possible to expand the environment variable in the FreeFileSync window?
Currently, I have it set up to use an enironment variable, ActivDir, and then
I have "%ActivDir%" as the left directory in my .ffs_gui file, which is loaded
when I run FreeFileSync from the BAT file. When FreeFileSync runs, I would
prefer the actual directory to appear instead of "%ActivDir%". I'm not sure if
this is possible.

I'm trying to facilitate the process of syncing the new version of a
downloaded program with the current version which exists on my "flash drive"
partition of my hard drive. It would help me, as a visual person, to see the
directory name for the "host" directory, since the "target" directory will be
similar.

For example, I just upgraded my Othello game, and the "host" directory was
"othello300" with the "target" being "E:\Othello". It would help me to see
"othello300" instead of "%ActivDir%", so that I can more easily remember which
target directory to look for.

Again, thanks a ton for your solution, it's exactly what I was looking for!
User avatar
Site Admin
Posts: 7058
Joined: 9 Dec 2007

Zenju

Sounds reasonable. But there are usecases where one doesnt' want to expand it,
e.g. when doing a daily backup using %date%. When changing such a
configuration the user wants %date% to be saved and not the "current date".
Maybe there is a solution to handle both requirements, for expanding and
keeping it. I don't see it yet.
Posts: 4
Joined: 16 Dec 2009

codesaway

I see what you mean. I would agree that date/time shouldn't be expanded,
especially since the date/time would be when the sync starts, not when the
program is run, right?

Also, it sounds like if directory's were expanded, they would be saved as
their directory name, not with the variable name, which is not desired.

The only solution I can think of would be if a control has keyboard focus,
show the "internal" version (the one we see now), and when the control does
not have focus, expand the text. Regardless, date/time shouldn't be expanded,
because, personally, if I'm syncing with date/time, when running the sync, I
don't really care what date/time is stored - I'm just using the date/time
variables to store distinct backups.

This solution would allow retaining the "internal" representation (which we
see now), as well as showing the "expanded" representation, which is what I
described.

For example, when the program loads, the "compare" button (and not the
directorys) has keyboard focus, so both the left and right directory would
display the "expanded" form (while storing the "internal" form in memory, as
well). When a user clicks a directory (e.g. to edit it), the "internal" form
replaces the "expanded" form, so that the user edits the internal form (like
they do now). Finally, when saving, the "internal" form would be saved (like
it is now).

On the programming side, this process requires the ability to detect when a
control gains/loses focus and the ability to update the field accordingly.
Also, a change needs to be made to ensure that the "internal" form is the one
saved, regardless which form is being displayed
User avatar
Site Admin
Posts: 7058
Joined: 9 Dec 2007

Zenju

Cool idea! :) I'll see about implementing it.
Posts: 4
Joined: 16 Dec 2009

codesaway

Thanks!
Posts: 1
Joined: 11 Jan 2010

krad0000

Passing environment variables to ffs's batch file doesn't work correctly.

e.g. this code:



<Filter>
<Active>true</Active>
<Include>*</Include>
<Exclude>%copy_exclude%</Exclude>
</Filter>

set copy_exclude=*
set copy_src=0
set copy_dest=1
"C:\Program files\FreeFileSync\FreeFileSync.exe" SyncJob.ffs_batch



will copy entire directory 0 to 1.
User avatar
Site Admin
Posts: 7058
Joined: 9 Dec 2007

Zenju

Currently environment variables are supported only for directory input fields:

1. folder pairs on main screen
2. user-defined deletion directory
3. logfile directory

Environment variable support for filter settings is not implemented. Currently
I don't see real usecases for this.