I am using BestSync 2014 and am loving it so far, just wondering if it's possible to have BestSync run a batch file ONLY if a file has needed to be synced. If no file was synced I do not want the batch file to run. If this is not entirely possible I would rather the batch file not process the steps if there was nothing synced.
I would love to see a check box similar to the batch file to run before synchronization that states: "Run the application only when there are files need to be synchronized after scanning"
Any ideas?
Run batch file only if there was a file synced
Re: Run batch file only if there was a file synced
I came up with my own solution, feel free to use it:
This will only report if there are files, including files inside sub-folders - it will not count empty folders as a file and will return a result of empty
@echo off
goto :main
REM *** === Function "Test" ===================================================
:test
if not "%1" == "" (
if exist "%1" (
( dir /s /b /a-d "%1" | findstr "^" ) > nul && (
echo %1 not empty
) || (
echo %1 empty
)
) else (
echo %1 missing
)
) else (
echo error: no parameter
)
goto :EOF
REM *** === Main ==============================================================
:main
call :test "DownloadDirectoryHere"
This will only report if there are files, including files inside sub-folders - it will not count empty folders as a file and will return a result of empty
@echo off
goto :main
REM *** === Function "Test" ===================================================
:test
if not "%1" == "" (
if exist "%1" (
( dir /s /b /a-d "%1" | findstr "^" ) > nul && (
echo %1 not empty
) || (
echo %1 empty
)
) else (
echo %1 missing
)
) else (
echo error: no parameter
)
goto :EOF
REM *** === Main ==============================================================
:main
call :test "DownloadDirectoryHere"