Run Command Prob in Synchronization Settings

Get help for specific problems
User avatar
Posts: 5
Joined: 30 Apr 2019

PlateauRealm

At the end of a successful sync operation, I have set up a Run command to run a DOS batch file. This identical batch file is kept in both my "C:\Users\prizm\OneDrive\Config & Settings\FreeFileSync\" folder location and also in my "D:\Config & Settings Backup\FreeFileSync\" folder location. When I use the D:\Config & Settings Backup\FreeFileSync\KeePass Update OPER Drive.bat" folder location in my 'Run a command:' text box, the sync job completes without an error display. But, when I enter "C:\Users\prizm\OneDrive\Config & Settings\FreeFileSync\KeePass Update OPER Drive.bat" into my 'Run a command:' text box, save and run the job, I receive the error:

'Incorrect command line: File "C:\Users\prizm\OneDrive\Config & Settings\FreeFileSync\KeePass Update OPER Drive.bat" Arg: Error Code 1223: The operation was cancelled by the user. [ShellExecute]'.

Why does one run command give me an error but the other does not. I have verified that the path to each differently located batch file is correct. Also, the OneDrive located batch file's status in OneDrive is set to 'Always keep on this device'.

Is there a limitation with FileSync running a batch file from OneDrive instead of from a local drive folder?

Batch File:

@ECHO off
title Update OPER KeePass InUse and Archive Folders With OneDrive Same Folders

CLS

for /f "delims=" %%l in ('WMIC Path Win32_volume where "Label='OPER'" Get DriveLetter /format:list') do >nul 2>&1 set "SystemVolume_%%l"

IF EXIST %SystemVolume_DriveLetter% (GOTO cont1)
ECHO.
ECHO OPER Drive Not Found
goto error_end

:cont1
ECHO.
ECHO Updating OPER KeePass InUse and Archive Folders to [OPER] Drive....
"C:\Program Files\FreeFileSync\FreeFileSync.exe" "C:\Users\prizm\OneDrive\Config & Settings\FreeFileSync\ACER KeePass InUse & Archive OPER Update.ffs_batch"

if errorlevel 3 (
ECHO.
ECHO Synchronization was aborted
goto error_end
)

if errorlevel 2 (
ECHO.
ECHO Synchronization completed with errors
goto error_end
)

if errorlevel 1 (
ECHO.
ECHO Synchronization completed with warnings
goto error_end
)

if errorlevel 0 (
ECHO.
ECHO Synchronization completed successfully to drive %SystemVolume_DriveLetter% - drive name:[OPER]
CHOICE /N /C YN /T 7 /D Y >NUL
exit
)

:error_end
User avatar
Posts: 5
Joined: 30 Apr 2019

PlateauRealm

Thanks for pointing that out, Zenju. I use Bitdefender which supplants most all of Windows Defender protection monitoring. I gave Bitdefender exclusions to all FreeFileSync executables, folders and the batch file, and now I have no issues with FreeFileSync running the batch file from Onedrive. Thanks for the heads up.