robocopy to a net-drive path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to copy some files to a different compter with SERVER2003 system and a
share path, how to add logon and password to robocopy command line?
For example: I want to copy \\HOME\testfiles\ to \\SERVER\HOMEBACKUP\ with
logon name: SERVERadmin and passwd:testcopy
so, is the command line as:
robocopy.exe \\HOME\testfiles\ \\server\HOMEBACKUP\ logon:SERVERadmin
passwd:testcopy /ZE /MIR /log+:c:\temp\rocopyfile.log

is it correct? the log file revelaed wrong logon name and passwd!!
 
Berg said:
I want to copy some files to a different compter with SERVER2003 system and
a
share path, how to add logon and password to robocopy command line?
For example: I want to copy \\HOME\testfiles\ to \\SERVER\HOMEBACKUP\ with
logon name: SERVERadmin and passwd:testcopy

Hi Berg,

Robocopy does not provide any authentication mechanism of its own. The
design philosophy behind robocopy is that it does one job, very well. Other
aspects of an overall task - like authentication - need to be taken care of
by other tools, which (hopefully) also do their own one job, very well.

The easiest way to work around your problem would be to make an IPC$
connection to the server, before running robocopy. So:

NET USE \\server\IPC$ /u:serveradmin testcopy
robocopy.exe \\HOME\testfiles\ \\server\HOMEBACKUP\ /ZE /MIR
/log+:c:\temp\rocopyfile.log
NET USE \\server\IPC$ /D

The NET USE /D will delete the IPC$ connection as soon as Robocopy has
finished.

Hope it helps,
 
Back
Top