Robocopy to an Internal (Home) Server - Password Protected

Posted on 2012-08-28
Last Modified: 2012-08-29
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!
Question by:coreybryant
    LVL 18

    Expert Comment

    by:Sushil Sonawane
    Try Microsoft File server migration toolkit. It's easy for migration and GUI base.

    Download link is below mention.

    LVL 2

    Expert Comment

    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

    LVL 82

    Accepted Solution

    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

    LVL 29

    Author Closing Comment

    Thanks, I decided to use this one - it seemed to be the easiest
    LVL 2

    Expert Comment

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
    The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
    In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
    This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now