Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1006
  • Last Modified:

Robocopy to an Internal (Home) Server - Password Protected

Here is there the original files are:
C:\Users\coreybryant\Documents\Medical\Medical Records

Now I would like to robocopy them over to this protected server (yes I have the user / pass).

I found a few things in forums, some say create a .bat, some say don't.  

The copy of where I would like these to be place in:
\\Nas01\coreybryant\Medical Records

There are no folders to deal with or anything.  

I found Running Robocopy command remotely,
psexec.exe -u "DOMAIN\DOMAIN USER" -p "PASSWORD" cmd.exe /c Robocopy "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook" "\\server\servershare\%username%\Application Data"

I tried:
robocopy "C:\Users\coreybryant\Documents\Medical\Medical Records" "\\Nas01\coreybryant\Medical Records username" -p "password"

ERROR : Invalid Parameter #3 : "-p"

I don't know if I should use that psexec or not.

Thank you!
1 Solution
Sushil SonawaneCommented:
Try Microsoft File server migration toolkit. It's easy for migration and GUI base.

Download link is below mention.

why do you put credentials in robocopy command? What happens if you remove it?

For Example:
robocopy "C:\Users\coreybryant\Documents\Medical\Medical Records" "\\Nas01\coreybryant\Medical Records"

Open in new window

Create a batch file with the following content:
net use "\\Nas01\coreybryant\Medical Records\IPC$" "TheTopSecretPasswordInDoubleQuotes" /user:SomeUser
robocopy "C:\Users\coreybryant\Documents\Medical\Medical Records" "\\Nas01\coreybryant\Medical Records"
net use "\\Nas01\coreybryant\Medical Records\IPC$" /delete

Open in new window

coreybryantAuthor Commented:
Thanks, I decided to use this one - it seemed to be the easiest
P.S. it would be better to store credentials in cmdkey.exe then in plaintext batch

cmdkey /add:Nas01 /user:user /pass:yourpassword

you can then use oBdA's script (just remove user name and password) without risk of uncovering your password by someone else.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now