robocopy run as a specified user

I need to run a robocopy script as a certain user (\\computername\accountname) can I specify this somewehere within the script?

Who is Participating?
Miguel Angel Perez MuñozConnect With a Mentor Commented:
On script no, but you can schedule a job with special credentials or run robocopy using runas:
i copied this from robocopy manual .

You can configure the Schedule service to log on as a user account. Once the user account has been granted appropriate access to source and destination servers, you can schedule Robocopy jobs to copy files between them.
To configure the Schedule service to log on as a user account
      1.      In Services in Control Panel, click Schedule, and then click Startup.
      2.      In the Startup Type box, click Automatic or Manual.
      3.      In the Log On As box, select the account in which to run the service, and specify the correct logon password.

another way that i am thinking of is to create a batch file , and create a service with the apropriate credentials to run it.
hope that helps
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.