you can replace the whole script with single shell line to robocopy.