Move files after sync

Get help for specific problems
Posts: 3
Joined: 28 Feb 2020

Alex Fogerty

Hi guys,

Firstly I want to say I love this product, the animal picture during install made me smile :)

I'm doing what I think should be an easy task but it doesn't seem to work:

- I have set up a sync between a server and an SFTP with the update option enabled.
- On completion, all the files in the folder I've uploaded need to be moved to a folder called Sent
- In the Sychronisation settings I've set "Run a command:" and selected "On Success" and then run a move command, but I've tried the following command and it comes up with the error:

Error Code 0x2: The system cannot find the file specified. [ShellExecuteEx]

The command is:

move /y "S:\out\*.txt" "S:\out\sent\"

If I run this as a batch file it works perfectly so I don't know why it doesn't work?

I have tried other commands and so far only "cmd" runs. I tried to pipe the command to cmd but it doesn't like this (same error, but now Code 0x3 instead of Code 0x2).

I tried running the batch file on completion but it doesn't work either.

Any ideas?
User avatar
Site Admin
Posts: 7051
Joined: 9 Dec 2007

Zenju

FFS expects a process path with arguments. "Move" is only known to cmd.exe, so write instead:
cmd /c move /y "S:\out\*.txt" "S:\out\sent\"
Just like the examples here: https://freefilesync.org/manual.php?topic=external-applications
Posts: 3
Joined: 28 Feb 2020

Alex Fogerty

Hi Zenju,

Thank you for your help.

There is nothing in the folder but I still want it to run regardless. I tried your command (copied and pasted), but get this error below. Is that because there is nothing in the folder to move, or something else?

4:06:55 p.m. Error Executing command: cmd /c move /y "S:\out\*.txt" "S:\out\sent\" [Exit Code 1]
Last edited by Alex Fogerty on 03 Mar 2020, 03:29, edited 1 time in total.
Posts: 3
Joined: 28 Feb 2020

Alex Fogerty

The output from running the command in the CLI is:

A duplicate file name exists, or the file cannot be found.

The latter would be correct, I just don't want it to upload anything to the server just yet, as the server processes anything that arrives into the FTP straight away.

Running it again in command line with Test.txt results in:

C:\Windows\System32>move /y "S:\out\*.txt" "S:\out\sent\"
S:\out\Test.txt
1 file(s) moved.

Looks like everything has been resolved! Thanks for your help :)