Note: the publish-via-msbuild.bat shown here simply builds the site and drops it into a directory, transforming the Web.configs
It does NOT sync the directory in any meaningful way.
To do that, I recommend using a tool like Rsync or MSDeploy
MSDeploy example: