I am using the below ROBOCOY script for copying the data.
C:\ROBODO\ROBOCOPY.EXE "D:\PhyMD" "\\10.10.100.10\d$\PhyMD" /ZB /TEE /e /np /xo /v /sec /r:1 /LOG+:14032010.LOG
D:\PhyMD(Source) is located on another Server and \\10.10.100.10\d$\PhyMD(Destination) thing is that every time I have to connect the destination path when I start the command because the Server has different credential and also change the log file name as manually. I want to make a NT script for this.
Is it possible ?
%date:~6,4%-%date:~3,2%-%date:~0,2% will give you the date in YYYY-MM-DD format within a batch file - I use it here for my backups. Can you be a bit more clear on the first part?
Are you running Robocopy from Machine 1, trying to copy from Machine 2 to a share on Machine 3 (what it sounds like) or do you mean you're running robocopy on machine 1 (the same machine D:\PhyMD is on) and trying to copy to the share on machine 2?
If it's the latter, not sure that Robocopy can pass a different username/password, you'd have to either add an account on machine 2 with matching username/password or map a drive first and copy to that then disconnect afterwards - e.g.
net use E: \\10.10.100.10\d$\PhyMD /user:username password
C:\ROBODO\ROBOCOPY.EXE "D:\PhyMD" "E:\PhyMD" /ZB /TEE /e /np /xo /v /sec /r:1 /LOG+:%date:~6,4%-%date:~3,2%-%date:~0,2%.LOG
net use E: /delete
There are currently 1 users browsing this thread. (0 members and 1 guests)