@echo off set "source_path=C:\Users\YourUserFolder\AppData\Roaming\Microsoft\Spelling\en-AU\" set "dest_path=D:\YourOneDriveFolder\Apps\MindManager\" set file_name=default.acl set "source_file=%source_path%%file_name%" set "dest_file=%dest_path%%file_name%" :: Use xcopy to copy only newer files xcopy "%source_file%" "%dest_path%" /d /i /y >nul :: Check the exit code of xcopy if %errorlevel% equ 0 ( echo File copied successfully! %file_name% in %source_path% was the latest. ) else if %errorlevel% equ 1 ( echo No files were copied. %file_name% in %source_path% is not the latest or already exists in %dest_path%. ) else ( echo An error occurred during the copy operation. ) pause