You can also try this. pass the username and password as arguments. After copy it deletes the mapping & disconnects.
SET username=%1
SET password=%2
net use "\\xxx.xxx.xxx.xxx\Some Folder" %password% /user:domain\%username%
:copy
copy "\\xxx.xxx.xxx.xxx\Some Folder\New.txt" "D:\new.txt"
IF ERRORLEVEL 0 goto disconnect
goto end
:disconnect
net use "\\xxx.xxx.xxx.xxx\Some Folder" /delete
goto end
:end