Bat file for robocopy file-syncing on windows

Tried FreeFileSync and Rsync but this doesn’t require any external programs.

Last letter in the bat-file is the destination dir! F2 is rename in Windows.
So you put the file e.g. in D:\sound\cubase projects\WIP\exciting title\ and change the last letter to “robocopy 2 Z.bat”

Any ideas for tweaks?

“Run as Administrator” changes directory to c:\windows\system32\ so can’t use %cd% (CurrentDirectory) so %~dp0 has to be used and it works!
Doesn’t work without chopping of the last backslash hence the ~0,-1%.

Super fast in windows just right-click and press “e” and “unrem” the /MIR SOBER for clearing out Cubase back-ups etc.

“robocopy 2 H.bat”:

@echo off
set filename=%~n0
set driveletter=%filename:~-1,1%
set batfiledir=%~dp0
set batfiledir=%batfiledir:~0,-1%
set destdir=%driveletter%%batfiledir:~1%
@echo on

robocopy /E "%batfiledir%" "%destdir%" /ETA
rem robocopy /MIR "%batfiledir%" "%destdir%" /ETA

pause