How to copy files from a machine in different domain through Task Scheduler in Windows

I had a requirement to copy files(build output files) from my remote build machine to a SharePoint Virtual Machine automatically . These two machines were in two different domains. To get this task done, I created a batch file which will copy the files from build machine to SharePoint Virtual Machine. The batch file code is simple as shown below…