@echo on
@echo username: %1
@echo password: %2
@echo localFilePath: %3
@echo remoteDirPath: %4

REM net use \\server\share /user:username password
REM default 
REM 	persistent:yes
net use %4 /user:%1 %2 /PERSISTENT:NO
if %ERRORLEVEL% neq 0 (
  exit /b %ERRORLEVEL%
)

copy %3 %4 /Y

exit /b