Run Command After Sync - Possible to Use Volume Name as Part of the Path?

Get help for specific problems
User avatar
Posts: 143
Joined: 8 Mar 2017

Radish

In the Synchronisation Settings dialogue, at the bottom of the dialogue, there is an option to "Run a command after synchronisation."

I have a program, wxChecksums, that I use to generate an md5 checksums file for all the folders/files on the left-side that will be copied to the right-side of a synchronisation task. The md5 checksums file itself also gets synchronised to the right-side. I want to be able to automatically open that file on the right-side after the sync is done. So I set the "Run a command. . ." option to this:
"G:\DOCUMENTS BACKUP\- Backup.md5"
That command works.

The problem with this is that I'm having to specify an absolute path to the md5 file. What I would really like to do is be able to use the "volume name" for setting that path. The volume name for this particular drive is "USB". So I would like to do something like this:
[USB]"\DOCUMENTS BACKUP\- Backup.md5"
or (should it be):
"[USB]\DOCUMENTS BACKUP\- Backup.md5"
None of these two work. So really can someone say if there is a way of doing this?
User avatar
Posts: 2453
Joined: 22 Aug 2012

Plerry

The [USB] designator is an FFS internal one.
The Run Command After Sync is essentially an FFS external command.

But can't you solve this problem by assigning a persistent drive letter to that specific USB device?
See e.g. https://www.windowscentral.com/how-assign-permanent-drive-letter-windows-10
User avatar
Posts: 143
Joined: 8 Mar 2017

Radish

Hi, Plerry. I thought the situation might be as you describe. And the solution you offer is fine and would to some extent suit my simple needs for doing backups.

However, I can think of scenarios in which it wouldn't be fine for all users of FFS. So I would like to suggest that Zenju make it possible to use the volume name for the commands section of the Synchronisation Settings section of FFS. Basically the user puts in a command using the volume name; before issuing the command to the OS FFS parses the command looking for a volume name as part of a path; if FFS finds such a command, then it parses the path into useable from by the OS then issues the parsed command to the OS. Something like that would be a nice and useful touch to FFS.

Thanks again, though, much appreciated.
Posts: 9
Joined: 16 Aug 2019

tfa

... be able to use the "volume name" for setting that path. The volume name for this particular drive is "USB". Radish, 02 Aug 2018, 20:50
you can check under a Win command prompt the volume ID number of the drive ( as unique identifier) with

mountvol /d and getting in return a string like this:

Volume{f547cb0e-0de5-4f0c-9f7b-53375867938f}

this volume id you can parse into a command box, example below writes a small txt file into a USB drive with date & time of last sync and used instead of hard coded drive letters (that could change based on your Windows environment) this volume id that is more robust, important are the waved brackets {...} that encloses the volume id string

cmd /c echo. > "\\?\Volume{f547cb0e-0de5-4f0c-9f7b-53375867938f}\last filesync "%date%" at "%time%".txt"

I can only say it works under Windows 10/1903, other win version you might want to try

fully agree that the quite neat filesync internal variable [drive/path] would be nice thing to parse to an external command line for such case but probably good reason why they didn't want to implement this like @Plerry said